Re: Tcl faster than Perl/Python...but only with tricks...
- From: Stephan Kuhagen <stk@xxxxxxxxxx>
- Date: Sat, 30 Dec 2006 15:47:38 +0100
Mark Janssen wrote:
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.
This would be the Tcl-way to test performance, of course. But since the
Perl/Python Versions also have to load the their interpreter, I think it
would be not fair to skip this step for Tcl. But to check that, I just
checked an empty Tcl-Script with the same Method (four runs, average of the
last three), which shows, that skipping the tclsh-loading saves only
0.015s.
I think, the biggest "mistake" I made was not to take the while/gets into a
proc, as mentioned by Uwe Klein and George Petasis. That improves
performance because of bytecode compilation.
Regards
Stephan
.
- References:
- Tcl faster than Perl/Python...but only with tricks...
- From: Stephan Kuhagen
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Mark Janssen
- Tcl faster than Perl/Python...but only with tricks...
- Prev by Date: Re: Tcl faster than Perl/Python...but only with tricks...
- Next by Date: Re: Tcl faster than Perl/Python...but only with tricks...
- Previous by thread: Re: Tcl faster than Perl/Python...but only with tricks...
- Next by thread: Re: Tcl faster than Perl/Python...but only with tricks...
- Index(es):
Relevant Pages
|