.
D 2015-11-17T18:40:08.938
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment Phil\sBrooks\spresented\sat\sthe\s2015\sTcl\sConference,\sand\slater\r\nposted\sto\scomp.lang.tcl\sa\sdemonstration\sof\s[lappend]\sgrowth\r\nof\slarge\slists,\sand\ssome\sundesirable\sperformance.\s\sHere's\shis\r\ndemo\sscript\sas\sit\sappeared\sin\sclt:\r\n\r\nset\si\s0\r\nset\smy_list\s{}\r\nset\scount\s0\r\nset\st0\s[\sclock\sseconds\s]\r\n#\sCreate\sa\slist\swith\sa\sbillion\selements\r\nwhile\s{$i\s<\s1000000000}\s{\r\n\s\s\s\s\s\s\slappend\smy_list\s"List\selement\s$i"\r\n\s\s\s\s\s\s\sincr\scount\r\n\s\s\s\s\s\s\sif\s{\s[expr\s{fmod($count,\s100000000)}\s]\s==\s0.0}\s{\r\n\s\s\s\s\s\s\s\s\s\s#\sShow\sprogress\severy\s100\smillion\selements\r\n\s\s\s\s\s\s\s\s\s\sset\stnow\s[\sclock\sseconds\s]\r\n\s\s\s\s\s\s\s\s\s\sputs\s"elapsed\stime:\s[\sexpr\s{\s$tnow\s-\s$t0\s}\s]\sseconds"\r\n\s\s\s\s\s\s\s\s\s\sputs\s[llength\s$my_list]\r\n\s\s\s\s\s\s\s}\selseif\s{\s$count\s>\s403000000\s}\s{\r\n\s\s\s\s\s\s\s\s\s\s#\sShow\sprogress\smore\sincrementally\r\n\s\s\s\s\s\s\s\s\s\sif\s{\s[expr\s{fmod($count,\s1000)}\s]\s==\s0.0}\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\sset\stnow\s[\sclock\sseconds\s]\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\sputs\s"elapsed\stime:\s[\sexpr\s{\s$tnow\s-\s$t0\s}\s]\sseconds"\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\sputs\s[llength\s$my_list]\r\n\s\s\s\s\s\s\s\s\s\s}\r\n\s\s\s\s\s\s\s}\r\n\s\s\s\s\s\s\sincr\si\r\n}
J foundin trunk
J is_private 0
J login dgp
J priority 5\sMedium
J resolution None
J severity Important
J status Open
J submitter dgp
J subsystem 14.\sList\sObject
J title Undesirable\s[lappend]\sperformance\sas\sLIST_MAX\sis\sreached
J type Bug
K 32c5740a4d3e86b1973915d92f07d5aee6104a14
U dgp
Z a3fe9153c0239015c803e544822c566c