.
D 2011-07-29T19:32:22
J icomment Interesting:\sthis\sbenchmarker\sloops\scalls\sfrom\swithin\sTEBC,\sinvoked\sas\n\s\s\s{*}$args\nIOW,\sit\sdoes\ssidestep\smy\smain\sbeef\swith\s[time]\s(looping\sover\sTcl_EvalObjEx\scalls)\sand\sis\sa\sbetter\ssimulator\sof\s"real\sscript\sbehaviour".\sAn\seven\sbetter\s(?)\sapproach\swould\scompile\sa\sproc\sor\slambda\sthat\scontains\sa\sbc'ed\sloop\sover\sthe\sscript,\sand\srun\sthat.\n\nThe\sscript\smtime.tcl\s(attached)\stries\sto\sseparate\sthat\seffect\s(proc\smtime),\sand\salso\sto\sisolate\sthe\seffect\sof\sthe\sincreased\scommand\scall\soverhead\sin\s8.6.\sOn\smy\smachine\sI\sget\n\nmig@ari:~$\sDEVEL/tcl-core/core-8-5/unix/tclsh\s/tmp/mtime.tcl\ntcl8.5.9:\s\n[\stime\s$cmd\s$n]:\s1.93854\smicroseconds\sper\siteration\n[mtime\s$cmd\s$n]:\s1.81043\smicroseconds\sper\siteration\n[mtime\s$scr\s$n]:\s1.64805\smicroseconds\sper\siteration\nmig@ari:~$\sDEVEL/tcl-core/trunk/unix/tclsh\s/tmp/mtime.tcl\ntcl8.6b1.2:\s\n[\stime\s$cmd\s$n]:\s2.21536\smicroseconds\sper\siteration\n[mtime\s$cmd\s$n]:\s1.98749\smicroseconds\sper\siteration\n[mtime\s$scr\s$n]:\s1.69049\smicroseconds\sper\siteration\n\nNote\sthat\sthe\sfirst\srun\sis\sa\splain\s[time],\sthe\ssecond\sremoves\sthe\sTcl_EvalObjEx\soverhead,\sthe\sthird\sremoves\sthe\scommand\scall\soverhead.\sThe\sscript\sis\svery\smuch\sad-hoc,\sit\sis\snot\sso\strivial\sto\sgeneralise\seither\s[mtime]\snor\s[toBody]\s(it\srequired\sremoving\s[return]\sfrom\s[distance],\sfor\sexample).\n\nIn\sthe\sexample\sthen:\smost\sof\sthe\sslowdown\sseems\sto\sbe\sdue\sto\smeasurement\sproblems\s([time]\sis\s8.6\sunfriendly)\sand\sthe\sincreased\scommand\scall\soverhead\sin\s8.6\s(itself\smainly\sdue\sto\sNRE).\n
J login msofer
J mimetype text/plain
J username msofer
K 3380073fffffffffffffffffffffffffffffffff
U msofer
Z c23a865bb289d0d95ce2fd47b9208bcc