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 Anonymous Monk
on May 11, 2012 at 10:40 UTC ( #969969=note: print w/ replies, xml ) Need Help??


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

Hi, the OP here

Thank you for your input.

I went and tested for my specific performance problem: generation of HTML tables. It was a fairly dumb, CGI-ish test, and there were not-benchmarky things such as using SSL for the database connection, and the database being on another server etc. Database connection was a basic DBI + DBD::Pg.

The test was, in short: Query the database for the rows and format a HTML page of them, printing it to /dev/null. The table was about 300 rows, and had eight columns. There were a lot of function calls thanks to HTML escaping.

The contestants were Perl 5.14.2 i686-linux-thread-multi-64int and i686-linux-64int, run on an old x86 computer.

nothreads 33.8/s threads 28.7/s

I'm certain that I would get different results if I added a web framework, templating language, or even a HTTP server into the mix, or ran the database on the same computer, or whatever. But I guess I can say that non-threaded Perl is about 17% faster for this limited test.


Comment on Re: How much slower is perl (the binary) with threads than without?
Download Code
Re^2: How much slower is perl (the binary) with threads than without?
by Tux (Monsignor) on May 11, 2012 at 12:45 UTC

    When using a threaded perl, be sure to use DBI-1.620, as there have been changes in performance that mainly affect threaded builds.


    Enjoy, Have FUN! H.Merijn

      I suspect I had that version. The required modules were simply installed with /path/to/perl -MCPAN -e 'install DBD::Pg'.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2015-07-06 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (84 votes), past polls