aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorpatthoyts <patthoyts>2005-03-09 11:57:50 +0000
committerpatthoyts <patthoyts>2005-03-09 11:57:50 +0000
commitca2c0d2fb8164b5c493dc8bc040a5d4745899691 (patch)
treec514440dafec772c8a786b9e85839e6205469386 /tools
parent363f368a6168caf402ed97f7493a90d1e8fa922d (diff)
downloadjimtcl-ca2c0d2fb8164b5c493dc8bc040a5d4745899691.zip
jimtcl-ca2c0d2fb8164b5c493dc8bc040a5d4745899691.tar.gz
jimtcl-ca2c0d2fb8164b5c493dc8bc040a5d4745899691.tar.bz2
New file to tabulate accumulated benchmark data from bench.tcl -batch
Diffstat (limited to 'tools')
-rw-r--r--tools/benchtable.tcl48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/benchtable.tcl b/tools/benchtable.tcl
new file mode 100644
index 0000000..0e47006
--- /dev/null
+++ b/tools/benchtable.tcl
@@ -0,0 +1,48 @@
+#!/usr/bin/env tclsh
+#
+# Tabulate the output of Jim's bench.tcl -batch
+#
+# Copyright (C) 2005 Pat Thoyts <patthoyts@users.sourceforge.net>
+#
+# $Id: benchtable.tcl,v 1.1 2005/03/09 11:57:50 patthoyts Exp $
+
+proc main {filename} {
+ set versions {}
+ array set bench {}
+ set f [open $filename r]
+ while {![eof $f]} {
+ gets $f data
+ lappend versions [lindex $data 0]
+ set results [lindex $data 1]
+ foreach {title time} $results {
+ lappend bench($title) $time
+ }
+ }
+ close $f
+
+ puts "Jim benchmarks - time in milliseconds"
+ puts -nonewline [string repeat " " 21]
+ foreach v $versions {
+ puts -nonewline [format "% 6s " $v]
+ }
+ puts ""
+
+ foreach test [array names bench] {
+ puts -nonewline "[format {% 20s} $test] "
+ foreach v $bench($test) {
+ if {$v eq "F"} {
+ puts -nonewline " F "
+ } else {
+ puts -nonewline [format "% 6d " [expr {$v / 1000}]]
+ }
+ }
+ puts ""
+ }
+}
+
+if {!$tcl_interactive} {
+ set r [catch {eval [linsert $argv 0 main]} res]
+ puts $res
+ exit $r
+}
+ \ No newline at end of file