http://www.perlmonks.org?node_id=408432


in reply to How to make your Perl 30% faster

There is one single characteristic that is significantly improving your performance. The lack of ithreads support. From your print outs:

The "fast baby":

Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_LARGE_FILES PERL_IMPLICIT_CON +TEXT

and the installed version:

Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL +_IMPLICIT_CONTEXT

The gain from removing threads can vary between 10-40% in the tests we've done. However, you are not comparing like for like. The installed version is based on 5.8.0 and your fast version is based on 5.8.5.

Unfortunately RH, and probably several other distros, come with a threaded Perl. Even though when 5.8.0 was released, ithreads were not recommended for production environments. From what I understand, ithreads support is much more stable now.

--
Barbie | Birmingham Perl Mongers user group | http://birmingham.pm.org/

Replies are listed 'Best First'.
Re: The magic of threads
by Luca Benini (Scribe) on Nov 17, 2004 at 15:43 UTC
    You opinion about this it's nice. But also compiler version and perl version can giustify performance increase
      They can indeed. However, in this case the biggest factor is the none use of ithreads. In the tests we did here we did a like for like test, which showed a significant improvement when we simply recompiled without ithread support. If we were to add compiler flags I'm sure we could improve further, but as others have mentioned, adding further optimisations could have side effects.

      --
      Barbie | Birmingham Perl Mongers user group | http://birmingham.pm.org/

        I would expect the real gain to come from getting rid of PERL_IMPLICIT_CONTEXT/MULTIPLICITY (in addition to ithreads). Can you show perl -V from your tests?