.
D 2008-02-10T23:30:16
J assignee dkf
J cmimetype text/plain
J comment The\sattached\spatch\sagainst\s8.5.1\sis\sa\scleanup\sof\sthe\s[lrange]\simplementation,\sincluding:\n\n\s-\suse\sof\sT_LOL\sto\sstick\sto\sthe\sstyle\sof\sother\slist\sops,\sinstead\sof\sa\scomplex\sand\sunique\santi-shimmering\sshare-intrep\smechanism\sdedicated\sto\sa\srare\sand\salready\sfast\scase\s[lrange\s$x\s$x\s$x].\n\n\s-\sflattening\sof\sif-return's\sto\sstick\sto\sthe\sstyle\sof\sother\slist\sops,\simproving\sreadability.\n\n\s-\sdetection\sof\sunshared\scase\sto\soperate\sin-place,\sby\scalling\stwice\sTcl_ListObjReplace\s(in\scorrect\sorder).\n\nThe\sfirst\stwo\spoints\sare\sjust\sa\smatter\sof\sstyle,\sbut\sallow\sfor\sthe\sthird,\swhich\sis\sa\spretty\ssignificant\soptimization.\sMeasurements\son\sa\s100-million\slist\s[lrepeat\s100000000\s1]:\n\n\s[lrange\s...\s1\send]\sin-place\sgives\sa\s3x\sspeedup\n\s[lrange\s...\s0\send-1]\sin-place\sgives\sa\s24000x\sspeedup\n\n-Alex\n\n\n%\sset\sl\s[lrepeat\s100000000\s1];llength\s$l\n100000000\n%\stime\s{set\sl\s[lrange\s$l\s1\send];llength\s$l}\n814663\smicroseconds\sper\siteration\n%\sproc\sK\s{\sx\sy\s}\s{set\sx}\n%\stime\s{set\sl\s[lrange\s[K\s$l\s[unset\sl]]\s1\send];llength\s$l}\n272517\smicroseconds\sper\siteration\n\n%\sset\sl\s[lrepeat\s100000000\s1];llength\s$l\n100000000\n%\stime\s{set\sl\s[lrange\s$l\s0\send-1];llength\s$l}\n815985\smicroseconds\sper\siteration\n%\sset\sl\s[lrepeat\s100000000\s1];llength\s$l\n100000000\n%\stime\s{set\sl\s[lrange\s[K\s$l\s[unset\sl]]\s0\send-1];llength\s$l}\n34\smicroseconds\sper\siteration
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter ferrieux
J subsystem 17.\sCommands\sI-L
J title Lrange\scleanup\sand\sin-place\soptimization
J type Patch
K 1890831fffffffffffffffffffffffffffffffff
U ferrieux
Z 6bfadf429862dc079c0bb26047f98dc5