1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools: add a separate scan column for fast.vlang.io too

This commit is contained in:
Delyan Angelov 2021-04-02 20:53:01 +03:00
parent d7331f981b
commit 5229428d91
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 18 additions and 14 deletions

View File

@ -47,8 +47,8 @@ fn main() {
diff3 := 0 // measure('$vdir/vprod -x64 $vdir/cmd/tools/1mil.v', 'x64 1mil') 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') diff4 := measure('$vdir/vprod -cc clang $vdir/examples/hello_world.v', 'hello.v')
vc_size := os.file_size('v.c') / 1000 vc_size := os.file_size('v.c') / 1000
// parse/check/cgen // scan/parse/check/cgen
parse, check, cgen := measure_steps(vdir) scan, parse, check, cgen := measure_steps(vdir)
// println('Building V took ${diff}ms') // println('Building V took ${diff}ms')
commit_date := exec('git log -n1 --pretty="format:%at" $commit') commit_date := exec('git log -n1 --pretty="format:%at" $commit')
date := time.unix(commit_date.int()) date := time.unix(commit_date.int())
@ -67,6 +67,7 @@ fn main() {
<td>${parse}ms</td> <td>${parse}ms</td>
<td>${check}ms</td> <td>${check}ms</td>
<td>${cgen}ms</td> <td>${cgen}ms</td>
<td>${scan}ms</td>
</tr>\n' + </tr>\n' +
table.trim_space() table.trim_space()
out.writeln(table) ? out.writeln(table) ?
@ -114,9 +115,9 @@ fn measure(cmd string, description string) int {
return int(sum / 3) 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') 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() lines := resp.output.split_into_lines()
if lines.len == 3 { if lines.len == 3 {
parse = lines[0].before('.').int() parse = lines[0].before('.').int()
@ -126,7 +127,9 @@ fn measure_steps(vdir string) (int, int, int) {
ms_lines := lines.map(it.split(' ms ')) ms_lines := lines.map(it.split(' ms '))
for line in ms_lines { for line in ms_lines {
if line.len == 2 { if line.len == 2 {
// if line[1] == 'SCAN' { scan = line[0].int() } if line[1] == 'SCAN' {
scan = line[0].int()
}
if line[1] == 'PARSE' { if line[1] == 'PARSE' {
parse = line[0].int() 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
} }

View File

@ -9,7 +9,7 @@
font-family: Menlo, Monospace, 'Courier New'; font-family: Menlo, Monospace, 'Courier New';
} }
table { table {
width: 2000px; width: 1800px;
} }
table, td { table, td {
border-collapse: collapse; border-collapse: collapse;
@ -48,15 +48,16 @@ Source code: <a target=blank href='https://github.com/vlang/v/blob/master/cmd/to
<table> <table>
<tr> <tr>
<td></td> <td style='width:180px'>timestamp</td>
<td></td> <td style='width:85px'>commit</td>
<td style='width:400px'></td> <td>commit message</td>
<td style='width:120px'>v -o v.c</td> <td style='width:120px'>v -o v.c</td>
<td style='width:120px'>v -o v</td> <td style='width:120px'>v -o v</td>
<td style='width:130px'>v -x64 1mil.v</td> <td style='width:130px'>v -x64 1mil.v</td>
<td style='width:120px'>v hello.v</td> <td style='width:120px'>v hello.v</td>
<td style='width:120px'>v.c size</td> <td style='width:85px'>v.c size</td>
<td style='width:120px'>parse</td> <td style='width:55px'>parse</td>
<td style='width:120px'>check</td> <td style='width:55px'>check</td>
<td style='width:120px'>cgen</td> <td style='width:55px'>cgen</td>
<td style='width:55px'>scan</td>
</tr> </tr>