performance problem

Discussion in 'Perl Misc' started by Gizbo, Nov 26, 2007.

  1. Gizbo

    Gizbo Guest

    Hi,

    My workstation was recently upgraded to Fedora 8, and this has wreaked
    havoc on the performance of my perl application. I did a profile on
    the code and the problem appears to be within Scalar::Util. The thing
    is, I don't know what to do next... The code below used to take about
    2s to run, now it is several minutes! I use the Class::Std
    infrastructure, and that is generating the 320k calls to refaddr, but
    the same code producing the same number of calls runs in a couple
    seconds on an older workstation.

    Any suggestions?

    [ollivier@samba anc]$ dprofpp
    Total Elapsed Time = 328.8558 Seconds
    User+System Time = 308.8358 Seconds
    Exclusive Times
    %Time ExclSec CumulS #Calls sec/call Csec/c Name
    94.5 292.0 299.49 320314 0.0009 0.0009 Scalar::Util::refaddr
    2.00 6.188 7.447 320314 0.0000 0.0000 Scalar::Util::blessed
    0.72 2.210 139.71 166666 0.0000 0.0008 Class::Std::__ANON__
    0.48 1.488 113.10 2138 0.0007 0.0529 Class::Std::new
    0.41 1.259 1.259 320314 0.0000 0.0000
    UNIVERSAL::a_sub_not_likely_to_be_
    here


    Thanks
     
    Gizbo, Nov 26, 2007
    #1
    1. Advertising

  2. Gizbo

    smallpond Guest

    On Nov 26, 3:01 pm, Gizbo <> wrote:
    > Hi,
    >
    > My workstation was recently upgraded to Fedora 8, and this has wreaked
    > havoc on the performance of my perl application. I did a profile on
    > the code and the problem appears to be within Scalar::Util. The thing
    > is, I don't know what to do next... The code below used to take about
    > 2s to run, now it is several minutes! I use the Class::Std
    > infrastructure, and that is generating the 320k calls to refaddr, but
    > the same code producing the same number of calls runs in a couple
    > seconds on an older workstation.
    >
    > Any suggestions?
    >
    > [ollivier@samba anc]$ dprofpp
    > Total Elapsed Time = 328.8558 Seconds
    > User+System Time = 308.8358 Seconds
    > Exclusive Times
    > %Time ExclSec CumulS #Calls sec/call Csec/c Name
    > 94.5 292.0 299.49 320314 0.0009 0.0009 Scalar::Util::refaddr
    > 2.00 6.188 7.447 320314 0.0000 0.0000 Scalar::Util::blessed
    > 0.72 2.210 139.71 166666 0.0000 0.0008 Class::Std::__ANON__
    > 0.48 1.488 113.10 2138 0.0007 0.0529 Class::Std::new
    > 0.41 1.259 1.259 320314 0.0000 0.0000
    > UNIVERSAL::a_sub_not_likely_to_be_
    > here
    >
    > Thanks


    what were the old and new versions of perl?
    perl --version
    This is perl, v5.8.8 built for i386-linux-thread-multi

    also, versions for Scalar::Util?
    perl -e 'use Scalar::Util; print $Scalar::Util::VERSION;'
    1.19

    Why use Class::Std? The justification is to prevent users
    of your code from accessing the private fields of the classes, but
    how is that your problem? If users of a package bypass the approved
    methods and a change breaks their program, well, they were warned.
    I'm not a fan of forcing people to do things my way, but maybe you
    have good reasons.

    Also, there is a tiny chance that there could be something wrong
    in your code. I know that the possibility is vanishingly small,
    but you might post a snippet showing the problem just to set our
    minds at rest.
    --S
     
    smallpond, Nov 26, 2007
    #2
    1. Advertising

  3. Gizbo

    Ben Morrow Guest

    Quoth Gizbo <>:
    >
    > My workstation was recently upgraded to Fedora 8, and this has wreaked
    > havoc on the performance of my perl application. I did a profile on
    > the code and the problem appears to be within Scalar::Util.


    We've had reports before of Fedora 8 machines ending up with the
    pure-perl version of Scalar::Util. Try running

    perl -MScalar::Util=dualvar -e1

    ; if it fails you need to reinstall Scalar::Util, first making sure you
    have a C compiler installed.

    > UNIVERSAL::a_sub_not_likely_to_be_here


    Yes, this is your problem. This sub is a slightly nasty artefact of the
    pure-Perl implementation.

    Ben
     
    Ben Morrow, Nov 26, 2007
    #3
  4. Gizbo

    Gizbo Guest

    On Nov 26, 5:19 pm, Ben Morrow <> wrote:
    > Quoth Gizbo <>:
    >
    >
    >
    > > My workstation was recently upgraded to Fedora 8, and this has wreaked
    > > havoc on the performance of my perl application. I did a profile on
    > > the code and the problem appears to be within Scalar::Util.

    >
    > We've had reports before of Fedora 8 machines ending up with the
    > pure-perl version of Scalar::Util. Try running
    >
    > perl -MScalar::Util=dualvar -e1
    >
    > ; if it fails you need to reinstall Scalar::Util, first making sure you
    > have a C compiler installed.
    >
    > > UNIVERSAL::a_sub_not_likely_to_be_here

    >
    > Yes, this is your problem. This sub is a slightly nasty artefact of the
    > pure-Perl implementation.
    >
    > Ben


    Thanks, I was halfway there already (I figured out that something
    related to XS was missing and it wasn't supposed to run the perl
    implementation). Your confirms indeed that this is the problem.
    Thanks!!!

    Now I am trying to figure out how to reinstall Scalar::Util. Can I do
    this with cpan -i somehow?
     
    Gizbo, Nov 27, 2007
    #4
  5. Gizbo

    Gizbo Guest

    On Nov 26, 5:19 pm, Ben Morrow <> wrote:
    > Quoth Gizbo <>:
    >
    >
    >
    > > My workstation was recently upgraded to Fedora 8, and this has wreaked
    > > havoc on the performance of my perl application. I did a profile on
    > > the code and the problem appears to be within Scalar::Util.

    >
    > We've had reports before of Fedora 8 machines ending up with the
    > pure-perl version of Scalar::Util. Try running
    >
    > perl -MScalar::Util=dualvar -e1
    >
    > ; if it fails you need to reinstall Scalar::Util, first making sure you
    > have a C compiler installed.
    >
    > > UNIVERSAL::a_sub_not_likely_to_be_here

    >
    > Yes, this is your problem. This sub is a slightly nasty artefact of the
    > pure-Perl implementation.
    >
    > Ben


    This is what I get:

    [me@hostname]$ perl -MScalar::Util=dualvar -e1
    is only avaliable with the XS version at -e line 0
    BEGIN failed--compilation aborted.
     
    Gizbo, Nov 27, 2007
    #5
  6. Gizbo

    Ben Morrow Guest

    Quoth Gizbo <>:
    >
    > Thanks, I was halfway there already (I figured out that something
    > related to XS was missing and it wasn't supposed to run the perl
    > implementation). Your confirms indeed that this is the problem.
    > Thanks!!!
    >
    > Now I am trying to figure out how to reinstall Scalar::Util. Can I do
    > this with cpan -i somehow?


    perl -MCPAN -e'install Scalar::Util'

    or

    cpan -i Scalar::Util

    should do it. It may ask you some questions first: except for the one
    about which CPAN mirror to use (which you should answer as best you can)
    and the questions about sudo if you need it, the default answers are all
    fine. Note that you will need to test again afterwards to make sure you
    got the XS version this time: S::U carefully installs the pure-Perl
    version if it can't find your C compiler, so whatever went wrong last
    time it was installed may happen again.

    Ben
     
    Ben Morrow, Nov 27, 2007
    #6
  7. Gizbo

    Gizbo Guest

    Gizbo, Nov 27, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William A. Sempf

    Unusual performance problem.

    William A. Sempf, Aug 27, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    379
    William A. Sempf
    Aug 27, 2003
  2. jm
    Replies:
    1
    Views:
    529
    alien2_51
    Dec 12, 2003
  3. francois

    big performance problem

    francois, Feb 2, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    666
    Arthur Mnev
    Feb 6, 2004
  4. Scott Allen
    Replies:
    1
    Views:
    380
    arkam
    Apr 14, 2004
  5. Software Engineer
    Replies:
    0
    Views:
    357
    Software Engineer
    Jun 10, 2011
Loading...

Share This Page