in reply to Re: Re: Re: Re: Re: Re: Finding the size of a variable
in thread Finding the size of a variable

Gee, that sounds great! When can I use it? ;)

I'll be very interested to see just how fast it can walk every data structure in use by a large system like Bricolage. My gut reaction is still "a long time" but you clearly would know better than I!

-sam

  • Comment on Re: Re: Re: Re: Re: Re: Re: Finding the size of a variable

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: Re: Finding the size of a variable
by Elian (Parson) on Nov 11, 2002 at 21:26 UTC
    Well, try it now! :)

    If the walk of \%main:: is unmanageable now, getting CVs right won't help. OTOH, if it's fast now, it won't get a whole lot slower later...

      A few quick tests show Devel::Size::total_size(\%::main) on Bricolage taking around a half a second right after startup, on my PIII/600. As the app is used and the various memory caches start to fill up that time increases up to around 1 second per call.

      While that's certainly not bad for most uses, adding a 1 second overhead to every subroutine call would bring Bricolage (or any large Apache/mod_perl app) to a halt. Some actions require thousands of method calls, and most web browsers would time out before the response got back.

      However, you were right about one thing; it is a heck of a lot faster than Devel::Profiler!

      -sam

        Yow! That is too slow. I'll have to see what I can do to speed it up (I've a pretty good idea where things are likely to be slow) though I don't think it'll ever be fast enough if those are the numbers. Hrm. Plan B time.