ronh has asked for the wisdom of the Perl Monks concerning the following question:

On winXP this code runs more than 100 times faster under 5.6.1 than under 5.8. Maybe due to PerlIO? I tried to tell PerlIO to go away with :Win32 :crlf. No help. Can someone please tell me how to make 5.8 run this code as fast as 5.6.1
$| = 1; undef $/; # or not if slurping to array. my $file; my @file; my $START_TIME = time; my $filename = 'C:\Documents and Settings\ron\My Documents\FGwing\new +_rptgen\DATA\run001\ENG_mod.262-08_41_43'; # substitute your own big +file open (FILE, "$filename") or die "can't open $filename"; $file = <FILE>; # or @file= <FILE>; sub END{ my $END_TIME = time; my $RUN_TIME = $END_TIME - $START_TIME; print STDOUT "\n\n Phew, that took $RUN_TIME seconds.\n\n"; }

Replies are listed 'Best First'.
Re: 5.8 slowed relaitve to 5.6.1 (by PerlIO?)
by perrin (Chancellor) on Jun 10, 2003 at 17:26 UTC
    Did you compile 5.8 with thread support? Don't. Ultimately you may not be able to make it entirely as fast, since the unicode changes have supposedly slowed things down as well.
      It's active state build 805 which I believe is no threads. Isn't PerlIO responsible for unicode? Isn't there a way to say: don't expect encoding; go fast? If not, why not?
        It's active state build 805 which I believe is no threads.

        I doubt it. Check the output of perl -V.

        Isn't PerlIO responsible for unicode?

        Supporting unicode means changes in every part of perl. Regex, for exmaple.

        Isn't there a way to say: don't expect encoding; go fast? If not, why not?

        Do you have any idea how hard that is to do in a large and complex codebase like perl5? Parallel code paths for every operation? It's just not feasible.

        I'm very worried/intrigued by this (as I work for a company that's developing a data profiling tool with perl and we mainly use ActivePerl). Have you tried upgrading to 806?