File tree 2 files changed +16
-11
lines changed
2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 1
- Copyright (c) 2015, 2017 dbohdan
1
+ Copyright (c) 2015, 2017, 2019 dbohdan
2
2
3
3
Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 1
- # !/usr/bin/env tclsh
1
+ # ! /usr/bin/env tclsh
2
2
namespace eval benchmark {
3
- variable tclssg {../ssg.tcl}
3
+ variable tclssg [expr {
4
+ [info exists ::env(TCLSSG)] ?
5
+ $::env(TCLSSG) :
6
+ {../tclssg/ssg.tcl}
7
+ }]
4
8
variable benchmarks [list benchmark1]
5
9
}
6
10
7
- proc ::benchmark::run-tclssg {prefix command args} {
8
- variable tclssg
9
- exec -ignorestderr -- {*}$prefix $tclssg $command {*} $args
11
+ proc ::benchmark::run args {
12
+ puts " > $args "
13
+ exec -ignorestderr -- {*}$args >@ stdout
10
14
}
11
15
12
16
proc ::benchmark::main {} {
13
17
variable benchmarks
14
- puts " Tclssg version tested: [ run-tclssg {} version] "
18
+ variable tclssg
19
+
20
+ run $tclssg version
15
21
foreach benchmark $benchmarks {
16
22
for {set i 0} {$i < 3} {incr i} {
17
- run-tclssg time build [file join $benchmark input] > /dev/null
18
- }
19
- for {set i 0} {$i < 3} {incr i} {
20
- run-tclssg memusg build [file join $benchmark input] > /dev/null
23
+ # You need GNU time(1) for the "-v" flag.
24
+ run time -v $tclssg build [file join $benchmark input] |& \
25
+ awk {/(time|CPU|set size)/}
21
26
}
22
27
}
23
28
}
You can’t perform that action at this time.
0 commit comments