Re: Tcl faster than Perl/Python...but only with tricks...



Stephan Kuhagen wrote:
Alexandre Ferrieux wrote:


A simple way of removing all the "first time" overheads (interpreter
init, bytecode compilation) would be to do the comparison on a file ten
times larger (just cat it over and over again).


Good point. I made the file 100 times larger now, so they do not fit into
memory and no in-memory-processing has an advantage (which destroys my
first and fastest solution with reading the whole file and the using
regexpt to that large string). I used the fastest Tcl version mentioned
here until now (Uwe Klein: while and gets in a proc).

Just for the fun of it:
I changed the [gets $fd line] to [set line [read $fd 65536]].
the difference is negligible.

uwe
.



Relevant Pages

  • Re: Tcl faster than Perl/Python...but only with tricks...
    ... first and fastest solution with reading the whole file and the using ... here until now (Uwe Klein: while and gets in a proc). ... read ends up as an fgets C library call. ... due in part to the way each language sets up the channel e.g buffer size, ...
    (comp.lang.tcl)
  • Re: I/O on remote server
    ... Uwe Klein wrote: ... > # but you could start "cat" ... > # send an EOF ... > expect "prompt" ...
    (comp.lang.tcl)