<i>improve speed of read command</i> status still Open with 4 other changes
by
.
D 2000-11-10T21:22:49
J icomment Do\syou\sget\simproved\sperformance\sby\sspecifying\sthat\syou\sare\sreading\sbinary\sdata\sas\sopposed\sto\sdata\swhich\sneeds\sconverting\sto\sUTF-8/UNICODE?\s\sIf\sthat\s"fixes"\sthe\sproblem,\sthen\sthe\sproblem\sis\sdue\sto\sTcl's\sencoding\ssupport,\swhich\scan\shave\squite\sa\slarge\sperformance\spenalty.\s\sIn\sthat\scase,\sthere's\snot\sa\slot\sthat\scan\sbe\sdone\sabout\sit.\s\sYou\swould\sexpect\sPerl\sto\ssuffer\ssimilarly\sif\sit\swas\strying\sto\sdo\sencoding\sstuff\sthough!\n\nA\sshort\stest\slater,\sI\sfind\swhen\sreading\sbinary\sdata\sthat\sI\sget\smuch\sbetter\sperformance\swith...\n\n\sproc\sprocess\s{file}\s{\s\n\s\s\s\sset\sfp\s[open\s$file\sr]\n\s\s\s\sfconfigure\s$fp\s-translation\sbinary\n\s\s\s\sset\si\s0\s\n\s\s\s\sset\stime\s[clock\sseconds]\s\n\s\s\s\swhile\s{[string\slength\s[read\s$fp\s42]]\s!=\s0}\s{\s\n\s\s\s\s\s\s\sif\s{!([incr\si]\s%\s50000)}\s{\n\s\s\s\s\s\s\s\s\s\sset\snow\s[clock\sseconds]\s\n\s\s\s\s\s\s\s\s\s\sputs\s"[expr\s{$now\s-\s$time}]\ssecs,\s$i\srecs"\s\n\s\s\s\s\s\s\s\s\s\sset\stime\s$now\s\n\s\s\s\s\s\s\s}\s\n\s\s\s\s}\s\n\s\s\s\sclose\s$fp\s\n\s}\n\nUnfortunately,\sthe\sactual\sfigures\saren't\stoo\sgood\ssince\smy\scomputer\sstarted\sswapping...\s\s:^(\n
J login dkf
J mimetype text/plain
J username dkf
K 219228ffffffffffffffffffffffffffffffffff
U dkf
Z c6ccc6deafee93f61257ceb7d40cdb52