Skip to content
Tcl Source Code Artifact [184b38e588]
Login

Artifact [184b38e588]

Artifact 184b38e588622e30e90391f212985482c4480a2690094cfe109663acbe6643e3:

Ticket change [184b38e588] - Ticket [e02798626dfbcd7b|e02798626d] <i>clock command is 8 times slower with Tcl 9.0b1</i> status still Open with 3 other changes by sebres on 2024-02-26 22:28:04.
D 2024-02-26T22:28:04.179
J icomment Back\sto\sthe\sissue...\r\nUltimately,\sI\sfound\swhat\sthe\sproblem\sis:\sit\sis\snot\sclock\sat\sall\s(or\snot\sdirectly\sclock).<br/>Moreover,\sthe\sfix\susing\smerge\sof\sclock-speedup\swill\shelp\sonly\sconditionally.<br/>But\sI'll\stry\sto\sexplain\sit\sbit\sby\sbit...\r\n\r\nMy\sprofiler\smodule\sdoesn't\swork\sfor\s9.0\s(it\ssegfaults),\sso\sI\swrote\sa\ssmall\ssimple\stcl-level\sprofiler\stool\sand\sinjection\sfor\s<code>::tcl::clock::add</code>\s(since\sit\shas\sbeen\sshowing\sthe\ssame\sissue)\s-\s[https://gist.github.com/sebres/4da0d7679211122bb2fe4f0d2e80c908/1849bc383883aa78adf0705311296700a653951e|GIST/sebres/4da0d76792111(v1)]\r\n\r\nHow\sone\scan\ssee\sit\sdrastically\sincreased\stimes\sin\s<code>entloc</code>\sand\s<code>chngov</code>\sblocks.<br/>\r\nBoth\sof\sthis\sblocks\sdefinitely\suses\s<code>msgcat</code>,\sand\sif\swe'll\smeasure\s<code>chngov</code>\ssolely:\r\n\r\n\s\s\s\s%\stimerate\s{\snamespace\sinscope\s::tcl::clock\s{\smc\sGREGORIAN_CHANGE_DATE\s}\s}\r\n\s\s\s\s-3.939602\sµs/#\s253833\s#\s253832\s#/sec\s1000.001\snet-ms\r\n\s\s\s\s+2.451155\sµs/#\s407971\s#\s407971\s#/sec\s1000.000\snet-ms\r\n\r\nit'd\sshow\smarginal\sdeviation\s(it's\ssurely\sslower\sthan\s8.6,\sbut\sdoesn't\scost\s30µs/#\sand\sbasically\s10\stimes\sfaster\sthan\sif\sit\sis\sexecuted\swithin\s<code>::tcl::clock::add</code>).\r\n\r\nBecause\sit\salso\saffect\s<code>entloc</code>\sblock,\swhich\salso\suses\s<code>msgcat</code>,\sI\sguess\sthe\scatalogue\ssimply\sshimmers\ssomewhere\sinternally.\r\n\r\nTo\sconfirm\sthat,\sI\smodified\sthe\sgist\slike\shere\s-\s[https://gist.github.com/sebres/4da0d7679211122bb2fe4f0d2e80c908/revisions?diff=split&w=|GIST/sebres/4da0d76792111(v1)].\r\n\r\nAnd\sthe\sresult\sis\sas\sexpected\smany\stimes\sfaster,\sand\snow\sthe\sprofiler\sblocks\sare\ssorted\ssimilar\sto\s8.6\s(<code>init</code>\sand\s<code>calc</code>\sare\sbefore\sboth\sblocks\s<code>entloc</code>\sand\s<code>chngov</code>\susing\s<code>mc</code>).\r\n\r\n<b>My\sconclusion:\sthis\sis\srather\san\sissue\sof\s<code>msgcat</code>\s(or\sprobably\sthe\simpossibility\sto\suse\scertain\sAPI\sof\sit\sfrom\sC-code\swithout\sto\sshimmer).</b>\r\nMy\sguess\s-\ssome\scatalog\scontinuously\sshimmers\sbetween\sdict\sand\ssomething\selse\s(I\shave\sno\stime\sto\stake\sa\scloser\slook\sright\snow,\sbut\ssuspect\sthis\scould\sbe\sa\s[/../tips/doc/trunk/tip/490.md|TIP#490]\sor\s[/../tips/doc/trunk/tip/499.md|TIP#499]\s(or\ssome\s<code>mc</code>-enhancement\shereafter).\r\n\r\nThus,\sas\salready\sassumed,\sthis\sworsening\smust\sbe\sfixed\sregardless\sthe\sclock-speedup\smerge\s(or\sat\sleast\sdocumented\slike\s"don't\suse\s...\sanymore"),\sbecause\sotherwise\speople\susing\s<code>msgcat</code>\s(in\s"improper"\sway)\scould\sexperience\ssimilar\sregressions\sin\s8.7\sor\s9.0.
J login sebres
J mimetype text/x-fossil-wiki
K e02798626dfbcd7b33db19e0fc3a9fb9fa0714f4
U sebres
Z 818c53932e28401a4ade20a22169c530