ManasMarwah has asked for the wisdom of the Perl Monks concerning the following question:

Dear PerlMonks, I just migrated from RHEL5 to RHEL6 in one of my working project. Due to this Perl version has also been upgraded from Perl 5.8.8 to Perl 5.10.1 (Base Perl Package of RHEL 6.6). I observed few behavioral as well as performance Impact for the same Perl scripts which was used in Perl 5.8.8. Sharing few instances below: Profiler used: NYTProf 5.06

1st Instance. Test.pl
#!/usr/bin/perl -w use POSIX ":sys_wait_h";
profiler Output with Perl 5.8.8:
Timeon line Calls Timein subs 67µs 1 5.85ms spent 5.85ms making 1 call to POSIX::import
profiler Output with Perl 5.10.1:
Timeon line Calls Timein subs 178µs 2 23.0ms spent 17.9ms (935µs+16.9) within main::BEGIN@3 which was called: # onc +e (935µs+16.9ms) by main::RUNTIME at line 3 use POSIX ":sys_wait_h"; # spent 17.9ms making 1 call to main::BEGIN@3 # spent 5.17ms making 1 +call to POSIX::import
Query: Why is this extra call is going in Perl 5.10.1 Is it the reason for increase in time.

Replies are listed 'Best First'.
Re: Performance and Behavioral changes in Perl 5.8.8 and Perl 5.10.1
by Corion (Patriarch) on Aug 17, 2015 at 08:09 UTC

    Most likely it is that the profiler on 5.10 can instrument BEGIN blocks, which it could not do on 5.8.8.

      I'm confused and checked several online dicts for the term "to instrument" ...and still not sure what you're saying ...

      Do you mean that the profiler before 5.10 wasn't able to hook into BEGIN blocks but only ordinary subs and that the performance impact is a side effect of this measurement itself?

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

        "To instrument" means "to measure", but to me at least with a connotation of having points where to hook things to.

        I didn't even recognize the original comment as mine, and I'm not really sure what I meant back then. I guess that my reply stemmed from a reading of perl510delta or the changelog of the profiler.

        But yes, I think I suggested back then that the extra granularity/detail resulted in attributing 17 ms to a BEGIN call that was not separately accounted for in 5.8.8. I guess the time spent in the BEGIN block was added to the time spent in the main program.

Re: Performance and Behavioral changes in Perl 5.8.8 and Perl 5.10.1
by Anonymous Monk on Aug 17, 2015 at 07:40 UTC
    What?
      Facing same issue. Are you able to resolve the issue? RHEL 6.9 and Perl 5.10.1. Your help is more appreciate. Kindly let me know, what are the steps you taken to resolve this issue?

        Perl 5.8.8 and Perl 5.10.1 are out of support for a long time.

        If your issue in fact that your program spends 23ms in importing a module where it before spent 6ms, then I can only suggest that you (re)start processes more rarely.

        Otherwise, please explain what your actual problem is. Maybe show some relevant source code so that we can understand and reproduce your situation.