.
D 2000-10-26T05:03:51
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s4206\sRFE\nVersion:\s8.2.3\nSubmitDate:\s'2000-02-22'\nLastModified:\s'2000-03-30'\nSeverity:\sLOW\nStatus:\sAssigned\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sSolaris\nOSVersion:\sSunOS\s5.7\nMachine:\sUltra\sSparc,\s128MB\sof\sRAM,\sSingle\sProcessor.\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-10-25'\n\n\nName:\nDavid\sWhittle\n\nExtensions:\nSybtcl-2.5\s(although\sit\swas\snot\sloaded\sfor\sthe\stest).\n\nCustomShell:\nNone.\n\nReproducibleScript:\n#\sThe\sfile\srepresented\sby\s"test.file"\sshould\sbe\sa\sbinary\sfile\n#\swith\s2+\smillion\srecords,\swhere\sa\srecord\sis\sdefined\sas\s42\sbytes.\nset\sfp\s[open\stest.file\sr]\nset\si\s0\nset\stime\s[clock\sseconds]\nwhile\s{[read\s$fp\s42]\s!=\s0}\s{\n\s\s\s\sif\s![expr\s50000\s%\s$i]\s{\n\s\s\s\s\s\s\s\sset\snow\s[clock\sseconds]\n\s\s\s\s\s\s\s\sputs\s"[expr\s$now\s-\s$time]\ssecs,\s$i\srecs,\s[expr\s50000\s/\s($now\s-\s$time)]\srecs\sper\ssec"\n\s\s\s\s\s\s\s\sset\stime\s$now\n\s\s\s\s}\n}\nclose\s$fp\n\nObservedBehavior:\nThe\sissue\sthat\sI\shave\sfound\sis\sthat\srunning\sthe\sabove\sscript\s(which\sis\sessentially\sonly\sdoing\sa\sread)\stakes\s~8\sseconds\sto\sprocess\s50000\s"records".\sWhen\swe\scompared\sthis\sagainst\sa\ssimilar\sPerl\sscript,\sPerl\sout\sdid\sTcl\sby\sa\sfew\sorders\sof\smagnitude\s(Perl\sran\sthrough\s200000\sin\s~1\ssecond).\nI\slooked\sat\sthe\scode\sfor\sthe\sread\scommand\sand\sit\sappears\sto\sme\sthat\sthe\sissue\slies\sin\sthe\sentended\swork\swith\sthe\schannel\scode\sas\swell\sas\show\sit\sappears\sto\sattempt\sto\sprocess\seach\sbyte,\seven\sif\sno\sconversion\sis\srequired.\nI\salso\stried\stesting\sthis\sin\s8.1.1\s(The\sabove\sscript\swouldn't\swork\sin\s8.0\sand\sbelow\s(i'm\sguessing\sdue\sto\sthe\sbinary\sdata\sin\sthe\sfile))\swhich\sran\sa\sbit\sfaster\s(5\sseconds\sfor\s50,000\srecords)\sand\s8.3\swhich\sran\sabout\sthe\ssame\sspeed\sas\s8.2.3.\n\nDesiredBehavior:\nI\swould\sexpect\sunless\ssomething\shas\sbeen\sspecified\sdifferently\sin\sthe\sfconfigure\scommand\sthat\sit\swould\sbubble\sdown\sto\sa\ssimple\sfread\scommand\sfor\sincreased\sperformance\son\sthe\sreads.\n\n\n\nI\swould\sexpect\sa\snoticeable\sspeedup\sif\sthe\sstandard\sprogramming\nparadigms\swere\sfollowed.\s\sThis\sshould\sbe:\n\nproc\sprocess\s{file}\s{\n\s\sset\sfp\s[open\s$file\sr]\n\s\sset\si\s0\n\s\sset\stime\s[clock\sseconds]\n\s\swhile\s{[read\s$fp\s42]\s!=\s0}\s{\n\s\s\s\sif\s{!(50000\s%\s$i)}\s{\n\s\s\s\s\s\s\s\sset\snow\s[clock\sseconds]\n\s\s\s\s\s\s\s\sputs\s"[expr\s{$now\s-\s$time}]\ssecs,\s$i\srecs,\s[expr\s{50000\s/\s($now\s-\s$time)}]\srecs\sper\ssec"\n\s\s\s\s\s\s\s\sset\stime\s$now\n\s\s\s\s}\n\s\s}\n\s\sclose\s$fp\n}\nprocess\stest.file\n\nThat\sneeds\sto\sbe\stested\sfirst,\sbefore\swe\sevaluate\sthe\sI/O\s(which\ncould\slikely\sbe\simproved).\s\sOf\scourse,\sbulk\sreads\swith\srange\nfetches\swould\sthen\sbe\smuch\sbetter.\s\n--\s02/22/2000\shobbs\n\n
J foundin final:\s8.2.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 37.\sFile\sSystem
J title improve\sspeed\sof\sread\scommand
J type RFE
K 219228ffffffffffffffffffffffffffffffffff
U nobody
Z 072d4992dc7eaebdba282fcf41de71b7