Posted to tcl by kbk at Sun Nov 21 02:26:52 GMT 2010view raw

  1. $ ./tcltest
  2. % set i 0
  3. 0
  4. % time {set x [expr {[incr i] * 1e-3}]a} 1000000
  5. 3.281527 microseconds per iteration
  6. % set tcl_precision 17
  7. 17
  8. % set i 0
  9. 0
  10. % time {set x [expr {[incr i] * 1e-3}]a} 1000000
  11. 5.1265559999999999 microseconds per iteration
  12. % set tcl_precision 12
  13. 12
  14. % set i 0
  15. 0
  16. % time {set x [expr {[incr i] * 1e-3}]a} 1000000
  17. 5.933869 microseconds per iteration
  18. % exit
  19.  
  20. $ tclsh8.5
  21. % set i 0
  22. 0
  23. % time {set x [expr {[incr i] * 1e-3}]a} 1000000; # yeah, 8.5 is horrible
  24. 16.237774 microseconds per iteration
  25. % set tcl_precision 17
  26. 17
  27. % set i 0
  28. 0
  29. % time {set x [expr {[incr i] * 1e-3}]a} 1000000
  30. 4.1925800000000004 microseconds per iteration
  31. % set tcl_precision 12
  32. 12
  33. % set i 0
  34. 0
  35. % time {set x [expr {[incr i] * 1e-3}]a} 1000000
  36. 3.858285 microseconds per iteration
  37. % exit
  38. kennykb@kenny-family-server:~/SourceForge/tcl/kaboodle$