Posted to tcl by kbk at Sun Nov 21 02:16:38 GMT 2010view raw
- $ ./tcltest
- % set i 0
- 0
- % time {set a [expr {[incr i]*1e-9}]x} 1000000
- 4.573238 microseconds per iteration
- % set tcl_precision 17
- 17
- % set i 0
- 0
- % time {set a [expr {[incr i]*1e-9}]x} 1000000
- 4.2633270000000003 microseconds per iteration
- % set tcl_precision 12
- 12
- % set i 0
- 0
- % time {set a [expr {[incr i]*1e-9}]x} 1000000
- 4.001461 microseconds per iteration
- % exit
- $ tclsh8.5
- % set i 0
- 0
- % time {set a [expr {[incr i]*1e-9}]x} 1000000; # horrible before the fix
- 28.523233 microseconds per iteration
- % set tcl_precision 17
- 17
- % set i 0
- 0
- % time {set a [expr {[incr i]*1e-9}]x} 1000000
- 5.4804399999999998 microseconds per iteration
- % set tcl_precision 12
- 12
- % set i 0
- 0
- % time {set a [expr {[incr i]*1e-9}]x} 1000000
- 5.202241 microseconds per iteration
- % exit