@@ -3,6 +3,8 @@ import time
3
3
4
4
const compare_prod = '-prod' in os.args
5
5
6
+ const cleanup_tmp = '-no-cleanup' ! in os.args
7
+
6
8
fn gbranch () string {
7
9
return os.execute (r 'git branch --list|grep ^\*' ).output.trim_left ('* ' ).trim_space ()
8
10
}
@@ -38,7 +40,7 @@ fn show_size(fpath string) {
38
40
fn compare_size (fpath1 string , fpath2 string ) {
39
41
size1 := os.file_size (fpath1 )
40
42
size2 := os.file_size (fpath2 )
41
- diff_ := size2 - size1
43
+ diff_ := i64 ( size2 ) - i64 ( size1 )
42
44
println ('>>>>>> size("${fpath2:15} ") - size("${fpath1:15} ") = ${size2:10} - ${size1:10} = ${diff_:10} ' )
43
45
}
44
46
@@ -50,11 +52,11 @@ fn vcompare(vold string, vnew string) {
50
52
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'" )
51
53
compare_size ('ohw.exe' , 'nhw.exe' )
52
54
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'" )
56
58
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'" )
58
60
compare_size ('ov.exe' , 'nv.exe' )
59
61
}
60
62
@@ -139,5 +141,7 @@ fn main() {
139
141
// After all the measurements are done, delete all the generated temporary files,
140
142
// except the `vold` and `vnew` compilers, so that they can be used later in manual
141
143
// experiments:
142
- r ('rm -rf ohw* nhw* nv* ov*' )
144
+ if cleanup_tmp {
145
+ r ('rm -rf ohw* nhw* nv* ov*' )
146
+ }
143
147
}
0 commit comments