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




I asked myself, what make Tcl so damn slow here. I commented out the
if...puts...-part what made the thing twice as fast (and useless of
course...). But that shows, that matching only took half of the time, which
surprised me. I thought, reading the file and running through the
while-loop should take nearly no time...

So my question is, why are [gets] and or [while] so slow, and is there a
change to improve that? For text processing these are two very central
commands...


Are you sure gets and while are slow? At least a part of the result the
time command is giving is spent in intialization of the Tcl
interpreter. A better way to test the performance of the Tcl code would
be to use the [time] command to determine the time.
In my experience starting Tcl can be relatively slow if you have for
instance a lot of packages installed.

Mark

.



Relevant Pages

  • Re: Tcl faster than Perl/Python...but only with tricks...
    ... time command is giving is spent in intialization of the Tcl ... A better way to test the performance of the Tcl code would ... Perl/Python Versions also have to load the their interpreter, ...
    (comp.lang.tcl)
  • Re: How to clock any tcl command
    ... Is there any way in TCL ... prompt to get the time information ... have too severe side effects) is to use the time command: ...
    (comp.lang.tcl)
  • Re: performance ?
    ... It is soooo easy to measure performance of code in Tcl ... I didn't know the time command ...
    (comp.lang.tcl)
  • Re: tktreectrl on Solaris/HP
    ... twice as fast (as per the timings printed by the demo.tcl script) as our 64-bit 8.4.2 -misaligned version. ... Jeff Hobbs, The Tcl Guy ...
    (comp.lang.tcl)