[Israel.pm] content of big file on windows

Gaal Yahas gaal at forum2.org
Tue Mar 16 10:26:18 PST 2004

On Tue, Mar 16, 2004 at 07:40:04PM +0200, Offer Kaye wrote:
> While using Tie::File is a very elegant solution, when it comes to large
> files it isn't very efficient.
> Here are two solutions, one based on Tie::File and another based on an
> advice I found on perlfaq5:

Thanks for the benchmark, Ofer!

Uh, just to be sure, could you repeat it with the two tests in reverse
order, just to make sure caching wasn't the cause of the difference?

And: if speed really is an issue, it's silly to sysread through the
whole file. seek() say, 4k from the end and count \ns from there. The
code will not be simple if you want to allow for long lines, but I bet
it'd still be faster on any reasonable test data.

Gaal Yahas <gaal at forum2.org>

More information about the Perl mailing list