in reply to Re: perl5.10 Devel::Size behaviour changed?
in thread perl5.10 Devel::Size behaviour changed?

It turns out I was using a 64-bit 5.10 and 32-bit 5.8.6. but in some cases I see a more than twice difference between the 2 versions. The 32-bit 5.8.6 gives me 851144. The 64-bit 5.10 gives me this alarming huge number 49563404. Any idea in what cases this could be so?
  • Comment on Re^2: perl5.10 Devel::Size behaviour changed?

Replies are listed 'Best First'.
Re^3: perl5.10 Devel::Size behaviour changed?
by sang1986 (Novice) on Sep 04, 2009 at 10:54 UTC
    take this example. I get 56 with 5.8 32-bit but 176 with 64-bit perl5.10.
    perl -MDevel::Size=total_size -MDevel::Peek -e 'my @a; my $s = total_s +ize(\@a);print "\nSIZE : $s\n"; Dump \@a, 1' SIZE : 56 SV = RV(0x822f26c) at 0x8184a60 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x8184b14 SV = PVAV(0x8186c54) at 0x8184b14 REFCNT = 2 FLAGS = (PADBUSY,PADMY) IV = 0 NV = 0 ARRAY = 0x0 FILL = -1 MAX = -1 ARYLEN = 0x0 FLAGS = (REAL)
    with 5.10
    sankaran@invest5.hyd:/u/sankaran/base/src/perl/Deshaw/PDL> /usr/local +/bin/perl5.10 -MDevel::Size=total_size -MDevel::Peek -e 'my @a; my $ +s = total_size(\@a);print "\nSIZE : $s\n"; Dump \@a, 1' SIZE : 176 SV = RV(0x417520) at 0x417510 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x4b1ba8 SV = PVAV(0x41a388) at 0x4b1ba8 REFCNT = 2 FLAGS = (PADMY,RMG) MAGIC = 0x57dd10 MG_VIRTUAL = &PL_vtbl_arylen_p MG_TYPE = PERL_MAGIC_arylen_p(@) MG_FLAGS = 0x02 REFCOUNTED ARRAY = 0x0 FILL = -1 MAX = -1 ARYLEN = 0x0 FLAGS = (REAL)
Re^3: perl5.10 Devel::Size behaviour changed?
by BrowserUk (Patriarch) on Sep 04, 2009 at 12:53 UTC

    Again, I ask: which version of Devel::Size are you using?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I am using 0.71 version http://cpansearch.perl.org/src/TELS/Devel-Size-0.71/lib/Devel/Size.pm
      I'm still stuck without any clue as to how to handle this. :( Any ideas?

        Sorry no. Except petition p5p to back out the core change that causes this and revert to 5.8.9 until they do.

        Beyond that, realise that this is a few tens of extra bytes per array; if the array holds more than half a dozen scalars, then this new overhead just gets lost in the noise.

        And Devel::Size is a development/testing tool. Once you've sorted out whatever malady caused you to go looking, and stop using D::S, then for the most part you won't be getting those extra bytes any more.

        Finally, go through your code and change any references to $#array to ( scalar( @array ) - 1 ) and litter your code with large comments explaining why these should not be reverted.

        I don't think that there is anything you can do to an ex-OSS programmer, if they leave behind time bombs :)


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.