From f85955ef6789e0a2273d9553a4ddfd795760006c Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 9 May 2021 15:14:06 +0300 Subject: [PATCH] tools/fast: use a common set of options for all measurement commands --- cmd/tools/fast/fast.v | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/tools/fast/fast.v b/cmd/tools/fast/fast.v index a2f378159d..292a29f505 100644 --- a/cmd/tools/fast/fast.v +++ b/cmd/tools/fast/fast.v @@ -4,6 +4,8 @@ import os import time +const voptions = ' -skip-unused -show-timings -stats ' + fn main() { exe := os.executable() dir := os.dir(exe) @@ -39,16 +41,14 @@ fn main() { println(' Building vprod...') exec('v -o $vdir/vprod -prod -prealloc $vdir/cmd/v') // exec('v -o $vdir/vprod $vdir/cmd/v') // for faster debugging - diff1 := measure('$vdir/vprod -skip-unused -cc clang -o v.c -show-timings $vdir/cmd/v', - 'v.c') + diff1 := measure('$vdir/vprod $voptions -o v.c $vdir/cmd/v', 'v.c') mut tcc_path := 'tcc' $if freebsd { tcc_path = '/usr/local/bin/tcc' } - diff2 := measure('$vdir/vprod -skip-unused -cc $tcc_path -o v2 $vdir/cmd/v', 'v2') + diff2 := measure('$vdir/vprod $voptions -cc $tcc_path -o v2 $vdir/cmd/v', 'v2') diff3 := 0 // measure('$vdir/vprod -native $vdir/cmd/tools/1mil.v', 'native 1mil') - diff4 := measure('$vdir/vprod -skip-unused -cc clang $vdir/examples/hello_world.v', - 'hello.v') + diff4 := measure('$vdir/vprod $voptions -cc clang $vdir/examples/hello_world.v', 'hello.v') vc_size := os.file_size('v.c') / 1000 // scan/parse/check/cgen scan, parse, check, cgen, vlines := measure_steps(vdir) @@ -122,7 +122,7 @@ fn measure(cmd string, description string) int { } fn measure_steps(vdir string) (int, int, int, int, int) { - resp := os.execute_or_panic('$vdir/vprod -o v.c -show-timings -stats $vdir/cmd/v') + resp := os.execute_or_panic('$vdir/vprod $voptions -o v.c $vdir/cmd/v') mut scan, mut parse, mut check, mut cgen, mut vlines := 0, 0, 0, 0, 0 lines := resp.output.split_into_lines()