Skip to content
Tcl Source Code Artifact [42ef148c92]
Login

Artifact [42ef148c92]

Artifact 42ef148c928141c21477a5ec8d800d908d880f10:

Ticket change [42ef148c92] - New ticket [1523878fffffffff|1523878fff] <i>obviating init.tcl search.source in interp create</i>. by coldstore on 2006-07-17 14:29:36.
D 2006-07-17T14:29:36
J assignee nobody
J cmimetype text/plain
J comment [interp\screate]\sis\squite\sexpensive\sto\sperform,\sbecause\nthe\ssetup\sof\senvironment\sis\svery\sflexible.\n\n[interp\screate]\scalls\sTcl_CreateInterp()\sand\nTcl_Init(),\sTcl_Init()\sis\swhere\sthe\senvironment\sis\sset\sup.\n\nTcl_Init()'s\sprocessing\sfirst\sevaluates\sthe\sscript\sin\nthe\sC\schar*\stclPreInitScript\s(if\sany)\sand\sthen\nevaluates\sa\sscript\swhich\sis\shard-coded\sinto\stclInterp,\nwhich\sfirst\schecks\sto\ssee\sif\sa\sproc\stclInit\sexists,\ndefines\sit\sif\snot,\sthen\scalls\sit.\n\nThe\shard-coded\stclInit\ssearches\sthe\sfile\ssystem\sin\nseveral\swell\sknown\splaces\sfor\sa\sfile\scalled\sinit.tcl,\nwhich\sit\sthen\ssources.\n\nThis\ssearch/source\sis\srepeated\sfor\s*every*\s[interp\screate].\n\nI\swould\slike\sthe\sability\sto\sobviate\sthe\sexpensive\nsearching/sourcing\sfor\ssome\s[interp\screate]s.\n\nOne\sway\sto\sdo\sthis\sis\sto\sset\stclPreInitScript\sto\s"proc\ntclInit\s{}\s{}"\swhich\swill\sshort-circuit\sthe\ssearch/source.\n\nIf\sthe\sC\sfunction\sTclSetPreInitScript\swere\sexposed\sto\ntcl,\sone\scould\sperform\sthis\sshort-circuit\sprior\sto\n[interp\screate]\sand\sachieve\sa\s3-fold\sspeedup\sin\s[interp\ncreate],\saccording\sto\smy\stests.\n\nFurthermore,\sif\sthe\sthe\sfunction\swere\sexposed,\sthen\ninit.tcl\scould,\swhen\ssourced,\sstore\sits\seffective\ncontent\sinto\sthe\stclPreInitScript\sC\svariable\sas\sa\sproc\ntclInit\sbody,\sand\sthen\ssubsequent\s[interp\screate]s\nwould\suse\sthe\ssearched\sand\ssourced\sinit.tcl\nfunctionality\swithout\shaving\sto\sre-search\sand\sre-source\nthe\scode.\n\nThe\snecessary\schanges\sto\sachieve\sthis\sare\sminimal.\s\sThe\nspeedup\sshould\sbe\sconsiderable.\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter coldstore
J subsystem None
J title obviating\sinit.tcl\ssearch.source\sin\sinterp\screate
J type RFE
K 1523878fffffffffffffffffffffffffffffffff
U coldstore
Z d8872af8a518ed995e87731a4176ddd7