diff options
author | antirez <antirez> | 2005-03-02 22:29:31 +0000 |
---|---|---|
committer | antirez <antirez> | 2005-03-02 22:29:31 +0000 |
commit | 73b6f39dbcd17189f2817289381796a7f79a1007 (patch) | |
tree | 0ecbd62fd2804d3d5ce223e16d6bac840b1f4640 /bench.tcl | |
parent | 788753e626983e9524308bb6f9f92b7f0273b7a1 (diff) | |
download | jimtcl-73b6f39dbcd17189f2817289381796a7f79a1007.zip jimtcl-73b6f39dbcd17189f2817289381796a7f79a1007.tar.gz jimtcl-73b6f39dbcd17189f2817289381796a7f79a1007.tar.bz2 |
one more benchmark
Diffstat (limited to 'bench.tcl')
-rw-r--r-- | bench.tcl | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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} |