Skip to content
Tcl Source Code Artifact [fc45aad279]
Login

Artifact [fc45aad279]

Artifact fc45aad279ca34d273f80bd7819fb5f65a8b80ed:

Ticket change [fc45aad279] - Ticket [680169ffffffffff|680169ffff] <i>Tcl interpreter pkgIndex &#39;cache&#39;</i> status still Open with 4 other changes by basilik99 on 2012-05-02 02:02:05.
D 2012-05-02T02:02:05
J icomment I\sattached\san\senhanced\sversion\sof\sdgp's\sscript.\sI\srun\sTcl\s8.5.\son\sWindows.\sI\sput\sthe\scode\sright\safter\sWindows\simplementation\sof\sauto_execok.\n\n1-\sReplaced\s"~"\sby\s"$env(APPDATA)"\sas\sI\sam\son\sWindows.\n\n2-\sReplaced\sugly\sforeaches\s(sorry\sdgp!)\sby\s"lassign"\snew\scommand.\n\nNow\sfor\sreal\schanges:\n3-\sFixed\sa\sproblem\swhich\swas\sprobably\snot\spresent\sfor\sTcl\s8.4\s(for\swhich\syou\sinitialy\sdevelopped\sthe\spatch\sright?)\sParameter\s"version"\ssometimes\sgets\ssets\sto\s"0-",\swhich\sis\snot\saccepted\sas\sa\sversion\sin\s[package\sifneeded].\sSo,\swhen\sreading\sthe\scache,\savoided\sthe\scall\sto\sifneeded\swhen\sversion\swas\snot\sfound.\sAnyway,\sifneeded\scannot\sreturn\sdifferent\sfrom\s""\sin\sthat\scase...\n\n4-\sThe\sproposed\ssolution\sworked\sfor\salmost\sall\spackages,\sbut\snot\sfor\sThread.\sIndeed,\sits\spkgIndex.tcl\scontains:\npackage\sifneeded\sThread\s2.6.5\s[list\sthread_load\s$dir]\nwhere\s"thread_load"\sis\sa\sproc\sdeclared\sin\sthe\spkgIndex.tcl.\sSo\scaching\sonly\s[package\sifneeded]\sscripts\swas\snot\senough.\sI\shad\sto\scache\sthe\spkgIndex.tcl\sitself.\sI\sdidn't\scopy\sthe\spkgIndex.tcl's\scontent,\sbut\sonly\sits\spath.\sThen\sI\ssourced\sit\swhile\shaving\sset\s$dir.\sI\sneeded\sa\sspecial\strick\sat\sthe\send\sto\seffectively\sexecute\sthe\sscript\sinside\sthe\s[package\sifneeded],\snot\sonly\sthe\spkgIndex.tcl's\scontent.\sFor\sTM,\sI\sused\sthe\sprevious\ssolution.\nI\sam\sseeking\syour\scomments\sabout\sthis\schange.\n\nWith\syour\sinitial\spatch,\sI\sgot\sthe\sfollowing:\n%\stime\s{package\srequire\smd5}\n115286\smicroseconds\sper\siteration\n%\stime\s{package\srequire\stdom}\n125298\smicroseconds\sper\siteration\n%\stime\s{package\srequire\sTclx}\n468442\smicroseconds\sper\siteration\n\nWith\smy\snew\spatch,\sit\sis\ssimilar,\sbut\sa\sbit\sslower.\sBut\sthat's\sacceptable\sfor\sme\sas\sthe\ssolution\sis\sgeneric:\n%\stime\s{package\srequire\smd5}\n178442\smicroseconds\sper\siteration\n%\stime\s{package\srequire\stdom}\n138962\smicroseconds\sper\siteration\n%\stime\s{package\srequire\sTclx}\n497901\smicroseconds\sper\siteration\n\nPreviously,\sloading\smd5\stook\s5\sseconds,\stdom\saround\s3\sseconds,\sasme\sfor\sTclx!\n\nNow\sfor\squestions:\nQ1-\sI\sdo\snot\sunderstand\sthe\sbenefit\sof\sputting\sthe\scache\son\sthe\sTcl\sinstallation\sdirectory\s(which\sis\sa\snetwork\sdrive\sfor\sme).\sAnyway\sthe\scache\sis\sper-machine.\sA\scache\sin\suser's\slocal\sdirectory\swould\sbe\senough\sI\sthink.\sMoreoever,\sfor\sa\ssingle\smachine,\swe\sreached\sa\scache\sfile\sof\saround\s5000\slines.\sWhen\s10\sor\s20\susers\swill\suse\sthat\scache\ssystem,\sthe\sfile\sis\sgonna\sget\shuge!\s..\sprobably\sslow\sto\s[source]...\n
J login basilik99
J mimetype text/plain
J username basilik99
K 680169ffffffffffffffffffffffffffffffffff
U basilik99
Z 80abcf5ccf49bf03c3859211c44a10c9