timbunce / devel-nytprof

Devel::NYTProf is a powerful feature-rich source code profiler for Perl. (Mostly in maintenance mode, so PRs are much more likely to be acted upon than Issues.)
http://blog.timbunce.org/tag/nytprof/
67 stars 51 forks source link

What versions of Perl are compatible? Is there a setup guide for dummies somewhere? #88

Closed JakeSummers closed 8 years ago

JakeSummers commented 8 years ago

Good Evening,

I am a Java/Javascirpt dev trying to fix (speed up) some Perl code and I was hoping to use this tool to help.

What versions of Perl are compatible? I don't mind installing a new version of Perl, but we are using Perl 5.6 in production, so I would like results that would be consistent with that env. Will nytprof work with Perl 5.6? Should I use a specific version of nytprof?

I initially just checked out your git repo and tried to build using the instructions in the make file. When Perl 5.6 complained, I switched to Perl 5.10.1. This is where I am at:

$ git checkout master # commit 489ce46c647629631b99d90951cb2aeb5407f635

$ perl Makefile.PL
...
Warning: prerequisite Test::Differences 0.60 not found.
Writing Makefile for Devel::NYTProf

$ make
...

$ make test
...
    Test Summary Report
    -------------------
    t/42-global.t        (Wstat: 512 Tests: 0 Failed: 0)
      Non-zero exit status: 2
      Parse errors: No plan found in TAP output
    Files=55, Tests=4392, 96 wallclock secs ( 0.92 usr  0.24 sys + 14.04 cusr  4.63 csys = 19.83 CPU)
    Result: FAIL
    Failed 1/55 test programs. 0/4392 subtests failed.
    make: *** [test_dynamic] Error 255

After a bit more reading, I figured out that I need to use a package manager (CPAN) to install this. I did this which appears to have fixed the warnings from make about missing dependencies:

sudo perl -MCPAN -e shell # Invoking with a non-root  user didn't work
install Devel::NYTProf

Unfortunatly, I am still having problems with make test - error above.

To try and side-step this I started checking out earlier versions. I found that if I use v4.12 then make test won't fail. I didn't continue with v4.12 because it seems quite old in comparison and I was thinking that it may just be missing the failing tests.

Are there clear instructions for dummies anywhere on how to setup nytprof? Is nytprof compatible with my environment?

Thanks! Jake

JakeSummers commented 8 years ago

To answer one part of my own question, it seems like Perl 5.10.` should be supported:

Perl 5.10.1+ (or else 5.8.9+) is Recommended

These versions of perl yield much more detailed information about calls to BEGIN, CHECK, INIT, and END blocks, the code handling tied or overloaded variables, and callbacks from XS code.

Perl 5.12 will hopefully also fix an inaccuracy in the timing of the last statement and the condition clause of some kinds of loops: http://rt.perl.org/rt3/Ticket/Display.html?id=60954

Source.

Still not sure why the tests are failing (or if it matters).

timbunce commented 8 years ago

What versions of Perl are compatible?

This table may help.

I didn't continue with v4.12 because it seems quite old in comparison

It should still be very useful as a profiler.

The tests for NYTProf are very sensitive so can fail for odd reasons. I suggest you try using various versions and see what works for you.

timbunce commented 8 years ago

Closing this. Feel free to reopen if there's a need.