Re: Tcl faster than Perl/Python...but only with tricks...
- From: "Donal K. Fellows" <donal.k.fellows@xxxxxxxxxxxxxxxx>
- Date: Sun, 31 Dec 2006 14:22:38 GMT
Stephan Kuhagen wrote:
But [read] has the disadvantage that you can not read line by line, or do I
miss something here?
You have to write your code differently so that you can process multiple
lines at once, and then process the file in chunks (e.g. 1MB at a time).
The code to do this is a bit trickier, but it can be a big win if the
search term is expected to be uncommon.
And I just tried to set translation to binary, and it slowed things down. Am
I doing this wrong or is there something strange happening?
You're using [gets] with a binary channel, which isn't recommended at all.
Yes, that was of course the solution I finally came up with, but this
doesn't work of course, when files get really big.
If the file is really big, you'll find that the disk's seek times
dominate, whatever language you use.
Donal.
.
- References:
- Tcl faster than Perl/Python...but only with tricks...
- From: Stephan Kuhagen
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: George Petasis
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Stephan Kuhagen
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Alexandre Ferrieux
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Stephan Kuhagen
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Uwe Klein
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Ian Bell
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Donal K. Fellows
- Re: Tcl faster than Perl/Python...but only with tricks...
- From: Stephan Kuhagen
- Tcl faster than Perl/Python...but only with tricks...
- Prev 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):