Posted to tcl by Ro at Sun Mar 04 02:53:39 GMT 2007view raw
- # Gets slower and slower as you move up in versions!
- #
- # 13s on 8.3.2
- # 15s on 8.3.5
- # 26s on 8.4.13
- # 31s on 8.5a4
- #
- # WinXP SP2 Sempron 3000+, March 3rd, 2007
- console show
- puts $tcl_patchLevel
- proc up1timer {body} {
- set begin_time [clock seconds]
- uplevel $body
- set end_time [clock seconds]
- set time_elapsed [expr $end_time - $begin_time]
- puts "**elapsed $time_elapsed s**"
- }
- label .e -text go! -bg red -fg white
- pack .e -fill x -expand 1
- proc get_countries {} {
- set countries {}
- for {set i 0} {$i < 800} {incr i} {
- set x [clock clicks]_[clock seconds]
- lappend countries alphabetica_$x
- }
- return $countries
- }
- up1timer {
- set countries {}
- for {set i 0} {$i<3000} {incr i} {
- set x [get_countries]
- foreach el $x {lappend countries $el}
- .e conf -text $i ; update
- }
- }
Comments
Posted by miguel at Sun Mar 04 12:59:10 GMT 2007 [text] [code]
Please compare to http://paste.tclers.tk/167