aboutsummaryrefslogtreecommitdiff
path: root/bench.tcl
diff options
context:
space:
mode:
authorantirez <antirez>2005-03-02 22:29:31 +0000
committerantirez <antirez>2005-03-02 22:29:31 +0000
commit73b6f39dbcd17189f2817289381796a7f79a1007 (patch)
tree0ecbd62fd2804d3d5ce223e16d6bac840b1f4640 /bench.tcl
parent788753e626983e9524308bb6f9f92b7f0273b7a1 (diff)
downloadjimtcl-73b6f39dbcd17189f2817289381796a7f79a1007.zip
jimtcl-73b6f39dbcd17189f2817289381796a7f79a1007.tar.gz
jimtcl-73b6f39dbcd17189f2817289381796a7f79a1007.tar.bz2
one more benchmark
Diffstat (limited to 'bench.tcl')
-rw-r--r--bench.tcl17
1 files changed, 17 insertions, 0 deletions
diff --git a/bench.tcl b/bench.tcl
index 45a09cc..796ad02 100644
--- a/bench.tcl
+++ b/bench.tcl
@@ -187,6 +187,21 @@ proc rotate {count} {
}
}
+### DYNAMICALLY GENERATED CODE #################################################
+
+proc dyncode {} {
+ for {set i 0} {$i < 100000} {incr i} {
+ set script "lappend foo $i"
+ eval $script
+ }
+}
+
+proc dyncode_list {} {
+ for {set i 0} {$i < 100000} {incr i} {
+ set script [list lappend foo $i]
+ eval $script
+ }
+}
### RUN ALL ####################################################################
@@ -199,3 +214,5 @@ bench {repeat} {use_repeat}
bench {upvar} {upvartest}
bench {nested loops} {nestedloops}
bench {rotate} {rotate 100000}
+bench {dynamic code} {dyncode}
+bench {dynamic code (list)} {dyncode_list}