From 5229428d91147977dba9ed40a3698175e3aaf78a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 2 Apr 2021 20:53:01 +0300 Subject: [PATCH] tools: add a separate `scan` column for fast.vlang.io too --- cmd/tools/fast/fast.v | 15 +++++++++------ cmd/tools/fast/header.html | 17 +++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/cmd/tools/fast/fast.v b/cmd/tools/fast/fast.v index 9a366a2221..78f4d31890 100644 --- a/cmd/tools/fast/fast.v +++ b/cmd/tools/fast/fast.v @@ -47,8 +47,8 @@ fn main() { diff3 := 0 // measure('$vdir/vprod -x64 $vdir/cmd/tools/1mil.v', 'x64 1mil') diff4 := measure('$vdir/vprod -cc clang $vdir/examples/hello_world.v', 'hello.v') vc_size := os.file_size('v.c') / 1000 - // parse/check/cgen - parse, check, cgen := measure_steps(vdir) + // scan/parse/check/cgen + scan, parse, check, cgen := measure_steps(vdir) // println('Building V took ${diff}ms') commit_date := exec('git log -n1 --pretty="format:%at" $commit') date := time.unix(commit_date.int()) @@ -67,6 +67,7 @@ fn main() { ${parse}ms ${check}ms ${cgen}ms + ${scan}ms \n' + table.trim_space() out.writeln(table) ? @@ -114,9 +115,9 @@ fn measure(cmd string, description string) int { return int(sum / 3) } -fn measure_steps(vdir string) (int, int, int) { +fn measure_steps(vdir string) (int, int, int, int) { resp := os.execute_or_panic('$vdir/vprod -o v.c -show-timings $vdir/cmd/v') - mut parse, mut check, mut cgen := 0, 0, 0 + mut scan, mut parse, mut check, mut cgen := 0, 0, 0, 0 lines := resp.output.split_into_lines() if lines.len == 3 { parse = lines[0].before('.').int() @@ -126,7 +127,9 @@ fn measure_steps(vdir string) (int, int, int) { ms_lines := lines.map(it.split(' ms ')) for line in ms_lines { if line.len == 2 { - // if line[1] == 'SCAN' { scan = line[0].int() } + if line[1] == 'SCAN' { + scan = line[0].int() + } if line[1] == 'PARSE' { parse = line[0].int() } @@ -139,5 +142,5 @@ fn measure_steps(vdir string) (int, int, int) { } } } - return parse, check, cgen + return scan, parse, check, cgen } diff --git a/cmd/tools/fast/header.html b/cmd/tools/fast/header.html index c4f9781d29..7701770679 100644 --- a/cmd/tools/fast/header.html +++ b/cmd/tools/fast/header.html @@ -9,7 +9,7 @@ font-family: Menlo, Monospace, 'Courier New'; } table { - width: 2000px; + width: 1800px; } table, td { border-collapse: collapse; @@ -48,15 +48,16 @@ Source code: + timestamp + commit + commit message v -o v.c v -o v v -x64 1mil.v v hello.v - v.c size - parse - check - cgen + v.c size + parse + check + cgen + scan