Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How much slower is perl (the binary) with threads than without?

by dave_the_m (Parson)
on May 10, 2012 at 20:16 UTC ( #969858=note: print w/ replies, xml ) Need Help??


in reply to How much slower is perl (the binary) with threads than without?

It's generally regarded as being a "bit" slower, e.g. 10-20%. This is because each function takes an extra argument (the interpreter), data attached to ops has been moved into the pad (so is slightly slower to retrieve), and until recently, the malloc wrappers did a slow getting of the interpreter address on each call.

Of course, the actual slowdown will depend on the particular code and modules. For example, individual XS modules may be considerably slower if they haven't been written to take advantage of workarounds for certain compatibility slowdowns (e.g. PERL_NO_GET_CONTEXT). Until recently, DBI with DBD::mysql was 3 times slower under a threaded perl for a simple fetch() loop. It's now only 20% slower, having been reworked a bit.

Dave.


Comment on Re: How much slower is perl (the binary) with threads than without?
Re^2: How much slower is perl (the binary) with Unicode than without?
by Anonymous Monk on May 11, 2012 at 03:41 UTC

    While you're at it, do you have any feel for the overhead imposed by Unicode support?

      Is there a Perl without Unicode support?

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics

        Sure, 5.6.x :) also probably compiling perl without perliio removes many types unicode support, though i'm not sure if all

        Is there a Perl without Unicode support?

        I wish :)

        At least with threading, if you do not need them, you can build a version without them.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        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.

        The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://969858]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-09-16 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (51 votes), past polls