Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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

Replies are listed 'Best First'.
Re^2: How much slower is perl (the binary) with threads than without?
by Tux (Abbot) 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?
[Discipulus]: 65-35 joint venture marto? ;=)
[choroba]: Fibonacci at 34!
[marto]: Discipulus, what did you have in mind?
[marto]: sort of related, have you seen sonic pi
[Discipulus]: choroba less than perl -le ' $==1,(1 x $_)=~/(^)(1|11\1 )*(?{$=++})^/, print $= for 0..10'?? congrats
[Discipulus]: marto i had in mind something for stupid peoples with smart phones; a free app (this is the the non perl part..) and some hardware to sell in big cities

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2017-10-17 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (225 votes). Check out past polls.

    Notices?