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


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?

Replies are listed 'Best First'.
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
        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?

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