.
D 2004-01-15T03:13:13
J icomment Logged\sIn:\sYES\s\nuser_id=32170\n\n"yes"\sto\syour\squestion\sbelow.\s\sNote\sthat\sthe\s"path"\sobject\nresults\sof\s'glob'\scan\sbe\sdifferent\sto\sa\snormal\spath:\n\nglob\s-dir\s$dir\s*\n\nreturns\sspecial\spath\sobjects\swhich\sknow\sthat\sthey\sare\s'$dir'\nplus\sa\slittle\sbit.\s\sIt\scould\sbe\sthere\sis\sa\sslowdown\sjust\sfor\nthese\sspecial\spaths.\s\s(We\sshould\sadd\sa\sseparate\s'file\ndirname'\sbenchmark\son\san\sordinary\spath).\n\nHowever:\sI\sreally\sdon't\sknow\swhat\swould\sbe\sslower\swith\sthis\npatch\s(unless\sit\sintroduces\ssome\ssubtle\sweirdness\sI\shaven't\nthought\sabout).\s\sHere's\swhat\sthis\spatch\sdoes:\n\nTcl\s8.4/8.5:\sspend\slots\sof\stime\swith\srelative\spaths\schecking\nif\sthe\s'cwd'\shas\schanged.\s\sThis\sinvolved\scalling\sthe\sOS'es\ngetcwd,\sconverting\sthe\sencoding,\snormalizing,\screating\sa\npath\sobject,\scomparing\swith\sthe\sprevious\spath\sobject,\sand\nthen\susually\sthrowing\sit\sall\saway\sbecause\sno-one\shad\scalled\nchdir\sbehind\sour\sbacks\sto\schange\sthe\scwd\sanyway.\n\nTcl\s8.5+patch:\scache\sthe\snative\scwd\sand\sperform\san\simmediate\ncomparison\sof\sthe\sresult\sof\sgetcwd\swith\sthat\snative\scwd.\sIf\nit's\sthe\ssame,\sreturn\sthe\scached\svalue\swhich\sthen\nshort-circuits\severything\selse\s(no\snormalization,\sno\nencoding\sconversion,\sno\sobject\sbeing\screated).\n\nThere\sare\sa\sfew\sother\ssmall\schanges\sbeyond\sthe\sabove,\swhich\ncould\sbe\sto\sblame\s(some\scode\spaths\shave\schanged\sin\ntclPathName,\swhich\shelps\sto\ssimplify\severything,\sI\sthink!).\n\nThanks\sfor\sdoing\sall\sthis,\sand\sfor\spointing\sout\sthe\scode\nduplication\s--\sI'll\slook\sinto\sthat,\sprobably\safter\swe\nunderstand\sthis\sissue,\ssince\sfixing\sthis\smight\slead\nnaturally\sdo\sremoving\sthe\sduplication\sanyway...\n\n
J login vincentdarley
J mimetype text/plain
J username vincentdarley
K 871583ffffffffffffffffffffffffffffffffff
U vincentdarley
Z 2a589604499b1d71b99c05c4e1e6e597