Posted to tcl by miguel at Sat Jan 09 18:35:59 GMT 2016view pretty

This is a comment to dbohdan's http://paste.tclers.tk/-New/3711, which for some reason I could not attach there.


% puts [time {set a {}; for {set i 0} {$i < 100000} {incr i} {append a @}} 100]
28260.06 microseconds per iteration
% set l [list {} {set a {}; for {set i 0} {$i < 100000} {incr i} {append a @}}]
{} {set a {}; for {set i 0} {$i < 100000} {incr i} {append a @}}
% puts [time {apply $l} 100]
6265.57 microseconds per iteration