Posted to tcl by aspect at Tue Jul 02 00:06:08 GMT 2013view pretty

tclsh8.6 [~]dict set dict 5 5
5 5
tclsh8.6 [~]set arr(5) 5
5
tclsh8.6 [~]time {info exists arr(5)} 10000000
0.1506702 microseconds per iteration
tclsh8.6 [~]time {dict exists $dict 5} 10000000
0.1621209 microseconds per iteration
tclsh8.6 [~]time {info exists arr(4)} 10000000
0.1820209 microseconds per iteration
tclsh8.6 [~]time {dict exists $dict 4} 10000000
0.1612164 microseconds per iteration
tclsh8.6 [~] 

Comments

Posted by aspect at Tue Jul 02 00:27:49 GMT 2013 [text] [code]

tclsh8.5 [~]info pa 8.5.11 tclsh8.5 [~]dict set dict 5 5 5 5 tclsh8.5 [~]set arr(5) 5 5 tclsh8.5 [~]time {info exists arr(5)} 10000000 0.1359568 microseconds per iteration tclsh8.5 [~]time {dict exists $dict 5} 10000000 0.456245 microseconds per iteration tclsh8.5 [~]time {info exists arr(4)} 10000000 0.1652426 microseconds per iteration tclsh8.5 [~]time {dict exists $dict 4} 10000000 0.446756 microseconds per iteration