Skip to content

Commit e433d7c

Browse files
committed
tools: improve output of compare_pr_to_master.v
1 parent b76d05d commit e433d7c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/compare_pr_to_master.v

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import time
33

44
const compare_prod = '-prod' in os.args
55

6+
const cleanup_tmp = '-no-cleanup' !in os.args
7+
68
fn gbranch() string {
79
return os.execute(r'git branch --list|grep ^\*').output.trim_left('* ').trim_space()
810
}
@@ -38,7 +40,7 @@ fn show_size(fpath string) {
3840
fn compare_size(fpath1 string, fpath2 string) {
3941
size1 := os.file_size(fpath1)
4042
size2 := os.file_size(fpath2)
41-
diff_ := size2 - size1
43+
diff_ := i64(size2) - i64(size1)
4244
println('>>>>>> size("${fpath2:15}") - size("${fpath1:15}") = ${size2:10} - ${size1:10} = ${diff_:10}')
4345
}
4446

@@ -50,11 +52,11 @@ fn vcompare(vold string, vnew string) {
5052
r("v repeat --nmaxs 7 -R 3 '${vold} -no-parallel -o ohw.exe examples/hello_world.v' '${vnew} -no-parallel -o nhw.exe examples/hello_world.v'")
5153
compare_size('ohw.exe', 'nhw.exe')
5254

53-
r("v repeat --nmaxs 7 -R 3 '${vold} -check-syntax cmd/v' '${vnew} -check-syntax cmd/v'")
54-
r("v repeat --nmaxs 7 -R 3 '${vold} -check cmd/v' '${vnew} -check cmd/v'")
55-
r("v repeat --nmaxs 7 -R 3 '${vold} -no-parallel -o ov.c cmd/v' '${vnew} -no-parallel -o nv.c cmd/v'")
55+
r("v repeat --nmaxs 7 -R 3 '${vold} -check-syntax cmd/v' '${vnew} -check-syntax cmd/v'")
56+
r("v repeat --nmaxs 7 -R 3 '${vold} -check cmd/v' '${vnew} -check cmd/v'")
57+
r("v repeat --nmaxs 7 -R 3 '${vold} -no-parallel -o ov.c cmd/v' '${vnew} -no-parallel -o nv.c cmd/v'")
5658
compare_size('ov.c', 'nv.c')
57-
r("v repeat --nmaxs 7 -R 3 '${vold} -no-parallel -o ov.exe cmd/v' '${vnew} -no-parallel -o nv.exe cmd/v'")
59+
r("v repeat --nmaxs 7 -R 3 '${vold} -no-parallel -o ov.exe cmd/v' '${vnew} -no-parallel -o nv.exe cmd/v'")
5860
compare_size('ov.exe', 'nv.exe')
5961
}
6062

@@ -139,5 +141,7 @@ fn main() {
139141
// After all the measurements are done, delete all the generated temporary files,
140142
// except the `vold` and `vnew` compilers, so that they can be used later in manual
141143
// experiments:
142-
r('rm -rf ohw* nhw* nv* ov*')
144+
if cleanup_tmp {
145+
r('rm -rf ohw* nhw* nv* ov*')
146+
}
143147
}

0 commit comments

Comments
 (0)