<i>GrowStringBuffer and GrowUnicodeBuffer do not check for overflows</i> status still Open with 3 other changes
by
.
D 2023-05-05T06:57:10.759
J icomment Broadening\sthe\sscope\sof\sthis\sticket:\r\n\r\nAs\sTcl\s9\sdeals\swith\slarger\ssized\sdata,\sthe\saggressive\soverallocation\sof\smemory\sresults\sin\smemory\sallocation\spanics\swhen\sin\sreality\sthere\sis\senough\smemory\sto\ssatisfy\sthe\sactual\srequest\ssizes.\sTo\skeep\samortized\scost\sof\sallocation\sat\sO(1),\sit\sis\snot\sactually\snecessary\sto\sdouble\srequested\ssize\son\soverflow.\sAny\sfactor\s>\s1\ssuffices.\sMany\simplementations\shave\schanged\sto\s1.5.\sThis\schange\sis\simplemented\sin\sbranch\sbug-c9663296fd.\r\n\r\nThe\sbranch\salso\smakes\sone\sother\schange\s-\swhen\sthe\soverallocation\sfails,\sit\sfalls\sback\sto\sa\s"binary"\sscheme\sof\sreducing\soverallocation\sinstead\sof\sallocating\sthe\sexact\sor\sa\ssmall\sfixed\soverallocation.\r\n\r\nThe\sresults\sof\sthese\schanges\sare\sshown\sin\sthe\stable\sbelow.\sSince\sthe\schange\shas\sthe\spotential\sto\simpact\sperformance\sboth\smemory\scommit\sand\stime/op\sis\sshown.\r\n\r\n|\sOperation\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s|\sTrunk\s\s\s\s\s\s\s\s\s|\sbug-c9663296f\s|\r\n-----------------------------------------------------------------\r\n|\stimerate\s{lappend\sl\sx}\s20000\s\s|\s0.147346\sµs/#\s|\s0.146707\sµs/#\s|\r\n|\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s|\s1.58GB\s\s\s\s\s\s\s\s|\s1.07GB\s\s\s\s\s\s\s\s|\r\n|\stime\s{lappend\sl\sx}\s1000000000\s|\s0.229233\sus/#\s|\s0.219229\sus/#\s|\r\n|\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s|\s12.61GB\s\s\s\s\s\s\s|\s8.07GB\s\s\s\s\s\s\s\s|\r\n|\stime\s{append\ss\sx}\s1000000000\s\s|\s0.153472\sus/#\s|\s0.155471\sus/#\s|\r\n|\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s|\s1.58GB\s\s\s\s\s\s\s\s|\s1.17GB\s\s\s\s\s\s\s\s|\r\n\r\nAs\sseen\sabove,\sthere\sis\svery\ssignificant\ssavings\sin\smemory\swithout\ssacrificing\sperformance.
J login apnadkarni
J mimetype text/x-markdown
K c9663296fd31fbb2fa1ff1cf019b59f432983516
U apnadkarni
Z 799f6ffe66a6bc3f507146d7c65b281d