diff --git a/cmd/tools/fast/fast.v b/cmd/tools/fast/fast.v index d771111334..938fdd4210 100644 --- a/cmd/tools/fast/fast.v +++ b/cmd/tools/fast/fast.v @@ -28,7 +28,8 @@ fn main() { return } } - // Fetch the last commit's hash + + // fetch the last commit's hash commit := exec('git rev-parse HEAD')[..8] if !os.exists('table.html') { os.create('table.html') ? @@ -42,13 +43,10 @@ fn main() { return } } - // for i, commit in commits { message := exec('git log --pretty=format:"%s" -n1 $commit') - // println('\n${i + 1}/$commits.len Benchmarking commit $commit "$message"') println('\nBenchmarking commit $commit "$message"') - // Build an optimized V - // println('Checking out ${commit}...') - // exec('git checkout $commit') + + // build an optimized V println(' Building vprod...') os.chdir(vdir) ? if os.args.contains('-noprod') { @@ -56,9 +54,11 @@ fn main() { } else { exec('./v -o vprod -prod -prealloc cmd/v') } + // cache vlib modules exec('$vdir/v wipe-cache') exec('$vdir/v -o v2 -prod cmd/v') + // measure diff1 := measure('$vdir/vprod $voptions -o v.c cmd/v', 'v.c') mut tcc_path := 'tcc' @@ -71,23 +71,24 @@ fn main() { if os.args.contains('-clang') { tcc_path = 'clang' } + diff2 := measure('$vdir/vprod $voptions -cc $tcc_path -o v2 cmd/v', 'v2') diff3 := 0 // measure('$vdir/vprod -native $vdir/cmd/tools/1mil.v', 'native 1mil') diff4 := measure('$vdir/vprod -usecache $voptions -cc clang 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) - // println('Building V took ${diff}ms') + commit_date := exec('git log -n1 --pretty="format:%at" $commit') date := time.unix(commit_date.int()) - // + os.chdir(fast_dir) ? mut out := os.create('table.html') ? - // Place the new row on top + + // place the new row on top html_message := message.replace_each(['<', '<', '>', '>']) table = - '