in reply to How to make your Perl 30% faster

Well the faster was compilated with gccversion=3.4.2 the slower with 3.3 20030226(prerelease), two different kernel (!= kernel-headers), two different version of perl.... The slower is compilated with -DUSETHREAD, using multithreading can (not always) reduce cpu-bound performance application on no-SMP machine. Well, on the other way 30% is more or less the stimated gain from using 3.4 vs 3.3, but this test can be considered a useful test in this direction. If performance is your objective you can googling around for a perl script called cpuflags and use it's output as compiler flag, but attention some of the flags it suggest can break perl internal semantic. If you do it please report your success vs. failure. tried perlcc?

Replies are listed 'Best First'.
Re^2: How to make your Perl 30% faster
by PetaMem (Priest) on Nov 21, 2004 at 10:22 UTC
    Hi,

    the two different kernels don't matter in this case, as they only indicate on what kernel the perl was compiled on. Actually both interpreters run on the same kernel (2.4.26) now.

    Also I don't see any issue in comparing various perls compiled with various compilers. Basically we tried to be as pragmatic as possible: Given Perl X (where X is the parameter space): What can we do to make it faster?

    It was mentioned here, that disabling threads helps a lot (which I can confirm), but that also some e.g. linux distributions ship perl with threads enabled by default.

    I've recompiled Perl once again, this time also for the specific P4 architecture and fpmath=sse. The result: Binary is about 200k shorter, and the following execution times:

    Normalization of a Swedish Lexicon in our Language Processing Suite:
    
    own 5.8.0-threaded (old): 241 seconds 
    system 5.8.0+threads:     196 seconds
    "fast baby" from above:   178 seconds
    "new fast baby" (P4):     161 seconds
    
    You know - from a practical point of view it is not important how the speed gain was achieved, it's just important THAT it can be achieved, and that compilation of perl can matter.

    And one poster was right: The GCC we've used still didn't use autovectorization. I'm very interested what this will bring.

    perlcc is not an issue as it cannot compile even the simpler modules... Not even the -o option.

    Bye
     PetaMem
        All Perl:   MT, NLP, NLU