aboutsummaryrefslogtreecommitdiff
path: root/bench.tcl
diff options
context:
space:
mode:
authorantirez <antirez>2005-03-07 16:03:29 +0000
committerantirez <antirez>2005-03-07 16:03:29 +0000
commite35f47e4adf9ff34ebbf15b29f2cd4c5f88dcf72 (patch)
tree2e0b5dc64a62bb0f79549dab6b1134a283f48f0d /bench.tcl
parente6cc7925e3e08e8190a8d503c2675ebdced1bbce (diff)
downloadjimtcl-e35f47e4adf9ff34ebbf15b29f2cd4c5f88dcf72.zip
jimtcl-e35f47e4adf9ff34ebbf15b29f2cd4c5f88dcf72.tar.gz
jimtcl-e35f47e4adf9ff34ebbf15b29f2cd4c5f88dcf72.tar.bz2
[lsort] command and list sorting low-level functions (Pat Thoyts).
Speedup for floating point math (me).
Diffstat (limited to 'bench.tcl')
-rw-r--r--bench.tcl10
1 files changed, 7 insertions, 3 deletions
diff --git a/bench.tcl b/bench.tcl
index 84cea2c..202c69f 100644
--- a/bench.tcl
+++ b/bench.tcl
@@ -9,13 +9,17 @@ proc bench {title script} {
### BUSY LOOP ##################################################################
-proc busyloop {} {
+proc whilebusyloop {} {
set i 0
while {$i < 1850000} {
incr i
}
}
+proc forbusyloop {} {
+ for {set i 0} {$i < 1850000} {incr i} {}
+}
+
### FIBONACCI ##################################################################
proc fibonacci {x} {
@@ -67,7 +71,6 @@ proc heapsort {ra_name} {
if {$j < $ir} {
if {$tmp < [lindex $ra [expr {$j + 1}]]} {
set tmp [lindex $ra [incr j]]
- #eval [list a b c]
}
}
if {$rra >= $tmp} {
@@ -268,7 +271,8 @@ proc miniloops {} {
### RUN ALL ####################################################################
-bench {busy loop} {busyloop}
+bench {[while] busy loop} {whilebusyloop}
+bench {[for] busy loop} {forbusyloop}
bench {mini loops} {miniloops}
bench {fibonacci(25)} {fibonacci 25}
bench {heapsort} {heapsort_main}