fast: checkout each commit

pull/6157/head
Alexander Medvednikov 2020-08-18 01:11:58 +02:00
parent 40d91cc23b
commit fe5575f384
1 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,8 @@ fn main() {
message := exec('git log --pretty=format:"%s" -n1 $commit') message := exec('git log --pretty=format:"%s" -n1 $commit')
println('\n${i + 1}/$commits.len Benchmarking commit $commit "$message"') println('\n${i + 1}/$commits.len Benchmarking commit $commit "$message"')
// Build an optimized V // Build an optimized V
println('Checking out ${commit}...')
exec('git checkout $commit')
println(' Building vprod...') println(' Building vprod...')
exec('v -o $vdir/vprod -prod $vdir/cmd/v') exec('v -o $vdir/vprod -prod $vdir/cmd/v')
diff1 := measure('$vdir/vprod -cc clang -o v.c $vdir/cmd/v', 'v.c') diff1 := measure('$vdir/vprod -cc clang -o v.c $vdir/cmd/v', 'v.c')
@ -92,6 +94,7 @@ fn main() {
res.writeln(footer) res.writeln(footer)
res.close() res.close()
} }
exec('git checkout master')
os.write_file('last_commit.txt', commits[commits.len-1])? os.write_file('last_commit.txt', commits[commits.len-1])?
} }