Skip to content

Commit f85955e

Browse files
committed
tools/fast: use a common set of options for all measurement commands
1 parent 38d1622 commit f85955e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmd/tools/fast/fast.v

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import os
55
import time
66

7+
const voptions = ' -skip-unused -show-timings -stats '
8+
79
fn main() {
810
exe := os.executable()
911
dir := os.dir(exe)
@@ -39,16 +41,14 @@ fn main() {
3941
println(' Building vprod...')
4042
exec('v -o $vdir/vprod -prod -prealloc $vdir/cmd/v')
4143
// exec('v -o $vdir/vprod $vdir/cmd/v') // for faster debugging
42-
diff1 := measure('$vdir/vprod -skip-unused -cc clang -o v.c -show-timings $vdir/cmd/v',
43-
'v.c')
44+
diff1 := measure('$vdir/vprod $voptions -o v.c $vdir/cmd/v', 'v.c')
4445
mut tcc_path := 'tcc'
4546
$if freebsd {
4647
tcc_path = '/usr/local/bin/tcc'
4748
}
48-
diff2 := measure('$vdir/vprod -skip-unused -cc $tcc_path -o v2 $vdir/cmd/v', 'v2')
49+
diff2 := measure('$vdir/vprod $voptions -cc $tcc_path -o v2 $vdir/cmd/v', 'v2')
4950
diff3 := 0 // measure('$vdir/vprod -native $vdir/cmd/tools/1mil.v', 'native 1mil')
50-
diff4 := measure('$vdir/vprod -skip-unused -cc clang $vdir/examples/hello_world.v',
51-
'hello.v')
51+
diff4 := measure('$vdir/vprod $voptions -cc clang $vdir/examples/hello_world.v', 'hello.v')
5252
vc_size := os.file_size('v.c') / 1000
5353
// scan/parse/check/cgen
5454
scan, parse, check, cgen, vlines := measure_steps(vdir)
@@ -122,7 +122,7 @@ fn measure(cmd string, description string) int {
122122
}
123123

124124
fn measure_steps(vdir string) (int, int, int, int, int) {
125-
resp := os.execute_or_panic('$vdir/vprod -o v.c -show-timings -stats $vdir/cmd/v')
125+
resp := os.execute_or_panic('$vdir/vprod $voptions -o v.c $vdir/cmd/v')
126126

127127
mut scan, mut parse, mut check, mut cgen, mut vlines := 0, 0, 0, 0, 0
128128
lines := resp.output.split_into_lines()

0 commit comments

Comments
 (0)