Skip to content
Tcl Source Code Artifact [3db3ba7fc9]
Login

Artifact [3db3ba7fc9]

Artifact 3db3ba7fc91c1d2715f7fb871ea25eb93f0aded87686429462ae3a9a9f4bb1e5:

Ticket change [3db3ba7fc9] - Ticket [4731d31eff3e2245|4731d31eff] <i>iTcl and Tcl 8.6 performance with Tcl_Preserve</i> status still Open with 3 other changes by sebres on 2019-02-07 22:40:59.
D 2019-02-07T22:40:59.942
J icomment So\sas\sassumed\sit\slooks\slike\sItcl\sregression,\sand\sI\sam\smostly\sready\swith\sa\sfirst\sshot,\sillustrating\sthis\sbehavior\sin\sItcl.\r\n\r\nHere\syou\swill\sfind\smy\sthe\snew\sbranch\swith\srewritten\sseveral\smemory\sfacilities\s(preservation\sresp.\srelease\sof\sclasses\sand\sobjects/variables)\sin\sItcl.\r\n\r\n\s\s[https://core.tcl.tk/itcl/timeline?r=sebres-memopt-perf-branch|itcl/sebres-memopt-perf-branch]\r\n\r\nThis\shuge\sperformance\sregression\swas\sinitially\sintroduced\sin\s[https://core.tcl.tk/itcl/info/c7e729d15408ed4e|[c7e729d15408ed4e]]\swhich\swas\sfrom\sbegin\sbasically\sinappropriate\sfor\sthis\spurposes.<br/>\r\nI\sthink\sthe\sintention\swas\sto\sfind\sand\sprovide\sinstrumentation\sto\sdo\s(auto)-free\svia\sfreeProc\sof\sthe\sreleased\sItcl-primitives\s(like\sTcl_EventuallyFree\sdoes\sit\sin\sTcl),\sjust\sused\sfor\sthis\spurposes\stotally\sunsuitable\sfunction-set\s(Tcl_Preserve/Tcl_Release)\swhich\sis\sbasically\sused\sin\sTcl\sto\sprotect\slarge\sblocks\sresp.\sfor\smanaging\sstorage.\sFor\sother\sthings\seven\sif\sit\sis\sanyway\snot\sallowed\sacross\sthreads\s(like\sthis\sItcl\sbasic\sfacilities\sare),\sTcl\suses\ssimple\sref-counting\smodels.\r\n\r\nJust,\sbecause\sseveral\sroutines\s(like\sItcl_PreserveData/Itcl_ReleaseData)\sare\spublic\sinterface\snow,\sI\swas\sforced\sto\srewrite\sinternals\sonly\swithout\sgreat\simpact\sof\sthe\spublic\sAPI\s(I'm\spretty\ssure\sI\sgets\sanyway\sseveral\sobjections\sfrom\sTCT\sabout).\r\n\r\nThe\sfirst\sresults\sare:\r\n\r\n<code><pre\sstyle="padding-left:10pt">\r\n\s\s1)\sRate\sof\sItcl-classes\sonly\s-\s83.5470\sµs/#\s11963\s#\s11969.3\s#/sec\s999.473\snett-ms\r\n\s\s1)\sRate\sof\sItcl-vars\sonly\s\s\s\s-\s2.747414\sµs/#\s357526\s#\s363978\s#/sec\s982.272\snett-ms\r\n\s\s2)\sRate\sof\sItcl-classes\sonly\s-\s78.6557\sµs/#\s12707\s#\s12713.6\s#/sec\s999.478\snett-ms\r\n\s\s2)\sRate\sof\sItcl-vars\sonly\s\s\s\s-\s2.712135\sµs/#\s362093\s#\s368713\s#/sec\s982.045\snett-ms\r\n\s\s3)\sRate\sof\sItcl-classes\sonly\s-\s78.0048\sµs/#\s12812\s#\s12819.7\s#/sec\s999.398\snett-ms\r\n\s\s3)\sRate\sof\sItcl-vars\sonly\s\s\s\s-\s2.602542\sµs/#\s377227\s#\s384239\s#/sec\s981.749\snett-ms\r\n</pre></code>\r\n\r\nFurther\sgood\snews\sis\sthe\sgrowth\sof\stime\sis\sstopped\sby\sgrowth\sof\sthe\svariable\snumber\s(due\sto\slist/hash-less\simplementation).\sSo\sit\swas\sable\sto\screate\s40K\sclasses\sas\swell\sas\sover\sa\s1M\svariables.\r\n\r\nAs\swell\sas\sby\syour\sinitial\stest\scode\sfrom\shere\s(as\sdiff\sfor\sbefore/after\son\smy\smachine)\sit\slooks\snow:\r\n\r\n<code><pre\sstyle="padding-left:10pt">\r\n<span\sstyle="color:\s#ff0000">-\sInitial\s10\sclasses\s-\s78647\smicroseconds\sper\siteration</span>\r\n<span\sstyle="color:\s#009800">+\sInitial\s10\sclasses\s-\s\s4729\smicroseconds\sper\siteration</span>\r\n<span\sstyle="color:\s#ff0000">-\s\s\sFinal\s10\sclasses\s-\s75752\smicroseconds\sper\siteration</span>\r\n<span\sstyle="color:\s#009800">+\s\s\sFinal\s10\sclasses\s-\s\s5037\smicroseconds\sper\siteration</span>\r\n</pre></code>\r\n\r\nAlthough\sI'm\snot\scompletely\sready\shere\s(still\ssome\slittle\schecks,\sfind\sand\sfixes\sof\sother\sparallel\sregressions,\sreview,\sdocumentation,\sconvince\sof\sTCT\setc),\sbut\syou\scan\scheck/try\sthis\sif\syou\swant.\r\n\r\nAnyway\sI\slet\sthis\sticket\sopen,\sbecause\sI've\sanother\sperformance-related\sbranch\swhere\sthe\sTcl_Preserve/Tcl_Release\sfacilities\sare\srewritten\sfrom\sme\sand\sdon't\shave\sthe\sregression\s(you\sobserved)\sby\sgrowth\sof\sblocks\snumber.<br/>\r\nJust\sas\salready\ssaid\sthis\smechanism\sis\stotally\sinappropriate\sfor\sItcl\sprimitives\sas\sit\swas\sused.
J login sebres
J mimetype text/x-fossil-wiki
K 4731d31eff3e2245b2300462b9185ab1b2645810
U sebres
Z 06c7c55338769d6c168b9ae064a03be3