Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Perl with internal Benchmark/Profiler

by PetaMem (Priest)
on Jun 15, 2006 at 11:19 UTC ( #555471=perlquestion: print w/replies, xml ) Need Help??
PetaMem has asked for the wisdom of the Perl Monks concerning the following question:


we happen to compile own perl interpreters a lot. Mainly to get up-to-date high-performance Perl Interpreters tailored exactly to our needs. Until now, to check impact of used compiler, compiler flags, perl configuration etc. we simply benchmarked some perl programms of ours.

It would be of great benefit, if there was some pragma or Module belonging to the Perl core, that could give information about the speed of various operations. It is evident, that the result of such benchmarking cannot be some one-dimensional number "this perl interpreter runs with xxx drystones", but rather a table where the speed of list creation, sorting, hash-lookup, iteration etc. would be benchmarked.

Ideally, the output of this would be easily parseable, so we could simply let our compiler run over the weekend and test all the perls with all the relevant flags. This should give us a fairly good overview how the different perls perform. Or didn't you always want to know how a perl-5.9.3 -O3 -msse2 -march=k8 64bit no-multiplicity compares to a 5.8.8 32bit perl -O2 ...

Anyone a hint how to proceed to get an exhaustive set of such benchmark results?

    All Perl:   MT, NLP, NLU

Replies are listed 'Best First'.
Re: Perl with internal Benchmark/Profiler
by dave_the_m (Prior) on Jun 15, 2006 at 11:48 UTC
    Sounds like you want perlbench.

    Note that differences of a few percent are usually noise: the effect of cache alignments etc.


      From what I can say so far: Yes! Strike! That's exactly what I was looking for. Great tool. And I have already seen some very unexpected results. Stay tuned, more to come...

          All Perl:   MT, NLP, NLU

Re: Perl with internal Benchmark/Profiler
by perrin (Chancellor) on Jun 15, 2006 at 11:57 UTC
    When I did something like this, I found that turning off threads and debugging (not the perl debugger, but debugging perl itself) made a big diference, and using the Intel compiler made a pretty big one too.
      I can confirm that tendency (from the impressions so far). But my intention is now to get some numbers to get a quantitative statement. Unfortunately, the Intel compiler performs far worse on 64bit Architectures than other options.

          All Perl:   MT, NLP, NLU

      Could you please elaborate some HowTo use the icc? After extensively using perlbench, I came to the conclusion that gcc 4.x sucks and tried icc. Unfortunately, I'm getting lots of these:
      icc -L/usr/local/lib -o miniperl \
          miniperlmain.o opmini.o libperl.a -lnsl -ldl -lm -lcrypt -lutil -lc
      IPO Error: unresolved : PL_comppad
              Referenced in /tmp/ipo_iccuB3iq9.o
      IPO Error: unresolved : PL_regfree
              Referenced in /tmp/ipo_iccuB3iq9.o
      IPO Error: unresolved : PL_regcompp
              Referenced in /tmp/ipo_iccuB3iq9.o
      IPO Error: unresolved : PL_peepp
              Referenced in /tmp/ipo_iccuB3iq9.o
      IPO Error: unresolved : PL_sortcop
              Referenced in /tmp/ipo_iccuB3iq9.o
      ultimatively failing the whole compile process - of course.

          All Perl:   MT, NLP, NLU

        Here is a message I sent to the mod_perl list with my results from the test.
        Sorry, I didn't have any trouble compiling with it so I can't tell you what the issue is. I was using a 32-bit processor -- Pentium 4, I think.
Re: Perl with internal Benchmark/Profiler
by vkon (Curate) on Jun 15, 2006 at 15:49 UTC
    In addition to already mentioned turning off threads/debugging, there could be a reason to try building with perl own memory allocator.

    This immediately brings binary incompatibility, but you can gain dramatic speed improvements on some OSes (PocketPC is one, and win32 is also; I have not tried comparing this elsewhere)


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://555471]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2018-07-19 12:07 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (407 votes). Check out past polls.