aboutsummaryrefslogtreecommitdiff
path: root/bench.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-01-24 12:05:36 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:44 +1000
commita7335808c5725934d81dbe68247b62a6ab08bf2f (patch)
treede45f62dacf49ebabc9b89a441b6d8c3e8f14256 /bench.tcl
parenta17425e476861fde1e1ad824181f97e081740659 (diff)
downloadjimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.zip
jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.tar.gz
jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.tar.bz2
More expr tests and fixes
*: Add tests/expr-new.test from Tcl *: Directly convert from int to double if possible *: Always treat '-' in front of a number as unary minus so that '-0x1234' works. *: Fix expr when the variable does not exist *: Add optional support for math functions *: Also double/0 == Inf or -Inf
Diffstat (limited to 'bench.tcl')
-rw-r--r--bench.tcl11
1 files changed, 11 insertions, 0 deletions
diff --git a/bench.tcl b/bench.tcl
index cf53219..9e7601a 100644
--- a/bench.tcl
+++ b/bench.tcl
@@ -160,6 +160,16 @@ proc ary n {
}
}
+proc ary_dict n {
+ for {set i 0} {$i < $n} {incr i} {
+ dict set x $i $i
+ }
+ set last [expr {$n - 1}]
+ for {set j $last} {$j >= 0} {incr j -1} {
+ dict set y $j $x($j)
+ }
+}
+
### REPEAT #####################################################################
proc repeat {n body} {
@@ -548,6 +558,7 @@ bench {heapsort} {heapsort_main}
bench {sieve} {sieve 10}
bench {sieve [dict]} {sieve_dict 10}
bench {ary} {ary 100000}
+bench {ary [dict]} {ary_dict 100000}
bench {repeat} {use_repeat}
bench {upvar} {upvartest}
bench {nested loops} {nestedloops}