Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

The magic of threads

by barbie (Deacon)
on Nov 17, 2004 at 14:59 UTC ( #408432=note: print w/replies, xml ) Need Help??

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 |

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 |

        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?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://408432]
and John Coltrane plays...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2018-06-23 03:33 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.