in reply to Re: How to reverse a huge file in Perl?
in thread How to reverse a huge file in Perl?

Wow. Might be interesting to take a peak at the tac source code to try to figure out what it's doing that's so much better than File::ReadBackwards. There must be a trick here, that's way more than the standard C-versus-Perl difference.

-sam

  • Comment on Re^2: How to reverse a huge file in Perl?

Replies are listed 'Best First'.
Re^3: How to reverse a huge file in Perl?
by BrowserUk (Patriarch) on Mar 26, 2008 at 17:48 UTC
      Didn't he already show you a wc -l? Did you test it yourself and get different results?

      -sam

        Didn't he already show you a wc -l? Did you test it yourself and get different results?

        No. He only added the wc after I asked how many lines were in the file. And I asked because the only way I could reproduce anything like his results was if I ran tac on a large file that contained few or no newlines. It is faster, but not by the margins his test showed.

        Then again, I'm using a win32 native port of tac and I do not know how close it is to the *nix version, or if it uses the same algorithm.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
      If the file he used doesn't contain any newlines

      Obviously, the file does contain 323833 newlines.