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 (Canon) 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'.