diff options
author | antirez <antirez> | 2005-03-07 16:03:29 +0000 |
---|---|---|
committer | antirez <antirez> | 2005-03-07 16:03:29 +0000 |
commit | e35f47e4adf9ff34ebbf15b29f2cd4c5f88dcf72 (patch) | |
tree | 2e0b5dc64a62bb0f79549dab6b1134a283f48f0d /bench.tcl | |
parent | e6cc7925e3e08e8190a8d503c2675ebdced1bbce (diff) | |
download | jimtcl-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.tcl | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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} |