<i>[package require] is too slow</i> status still Open with 4 other changes
by
.
D 2012-04-24T22:56:20
J icomment Hi,\n\nI\suse\sTcl\s8.6.0.0.b6.\n\ndgp\ssaid:\n"Trying\sto\sconvert\s[package\srequire]\sto\ssomething\sevent-driven\sis\sa\scontradiction\sin\sterms"\nI\sdidn't\smeant\srunning\s[package\srequire]\sin\sthe\sevent\sloop\s(and\sthen\swaiting\sfor\sits\scompletion\susing\supdate\sor\svwait).\sMy\sfirst\sidea\swas\sreally\sabout\sit\srunning\sin\sa\sdifferent\sthread,\sbut\sat\sthe\slevel\sof\sTcl\score.\sAgain,\swhen\sTcl\score\scommands\sasks\sinformation\sto\sthe\sOS\s(Windows\sin\smy\scase),\sthe\stclsh\sprocess\sis\ssuspended\swhile\sthe\ssystem\scall\sexecutes.\sThat\stime\scould\sbe\sused\sby\sthe\sTcl\score\sto\sterminate\snon-I/O\srelated\scommands\ssuch\sas\s[package\srequire].\n\nNow,\sfor\sthe\sideas\sposted,\shere\sis\sthe\stime\sfor\sloading\stdom\spackage\salone:\n%\stime\s{package\srequire\stdom}\n3294262\smicroseconds\sper\siteration\n\nThen\sI\stried\swhat\syou\srecommended\s(using\sload/source\sdirectly):\n%\sset\sdir\s{some_directory/lib/teapot/package/win32-ix86/lib/tdom0.8.3}\n%\stime\s{load\s[list\s[file\sjoin\s$dir\stdom083.dll]];\ssource\s[list\s[file\sjoin\s$dir\stdom.tcl]]}\n2260355\smicroseconds\sper\siteration\n\nThis\sis\ssaving\s1\ssecond.\sIts\sgood,\sbut\snot\senough.\sIt\sdoes\snot\sworth\shardcoding\sthe\spaths.\n\nI\salso\stried\sto\sdo\sboth\s[package\srequire]\sin\sa\sseparate\sthread:\n\npackage\srequire\sThread\nset\stdom_md5_thread\s[thread::create]\nthread::send\s-async\s$tdom_md5_thread\s{package\srequire\stdom}\nthread::send\s-async\s$tdom_md5_thread\s{package\srequire\smd5}\n\n...\ssearch\sin\sdirectories\shere\swhile\sthe\s2\s[package\srequire]\sare\sperformed\s...\n\nthread::send\s-async\s$tdom_md5_thread\s"set\sfile_to_check\s$file_to_check"\n\nthread::send\s-async\s$tdom_md5_thread\s\\\n{\n\s\s\sset\sxrd_in\s[open\s$file_to_check\sr]\n\s\s\sdom\sparse\s-simple\s[read\s$xrd_in]\sxrd_dom_tree\n\s\s\sclose\s$xrd_in\n\s\s\sset\sxrd_first_title0_node\s[lindex\s[$xrd_dom_tree\sselectNodes\s{XROD//APIDOC//TITLE[@LEVEL='0']}]\s0]\n\s\s\sreturn\s"[$xrd_first_title0_node\sasText].ptu"\n}\sptu_name\n\n...\ssome\scode\s...\nvwait\sptu_name\n\nIt\sworks,\sbut\sI\sdoubt\sthat\sI\sam\sreally\sgaining\stime.\sOne\sreason\sis\sthe\stime\sto\sinitialize\sthe\sthread:\n%\stime\s{package\srequire\sThread}\n1633521\smicroseconds\sper\siteration\n%\stime\s{thread::create}\n972502\smicroseconds\sper\siteration\n\nBut\salso\sthis\scomplexifies\smy\sscript.\sAnyway,\sthanks\sfor\sposting\sthis\sidea\sas\sit\smay\sbe\suseable\sin\sother\ssituations.\n\nEtienne\n
J login basilik99
J mimetype text/plain
J username basilik99
K 3519865fffffffffffffffffffffffffffffffff
U basilik99
Z 952edec3421904c16bbb8eb033f9dd3f