perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perrin Harkins" <per...@elem.com>
Subject Re: stupid optimization question
Date Thu, 17 May 2007 16:59:26 GMT
On 5/17/07, Jonathan Vanasco <jvanasco@2xlp.com> wrote:
> I'm refactoring a certain bottleneck, and looking for the dumbest
> tiniest improvements I can make in this one package.

I think you've found the dumbest and tiniest here.  I'd suggest
looking anywhere else.  There's probably something in your database
config that could be tweaked to make more difference than this.

> does anyone know about memory allocation with eval and closures ?
>
> are these essentially the same?
>
> my  $a= 10;
>
> vs.
>
> eval {
>         my $a= 10;
> }
>
> or is new memory allocated each time for the var in eval ?

That's just exception handling.  I don't expect it will behave
differently from a normal block if you don't throw an exception.  If
you meant to ask about string eval, there is a definite performance
hit and minor memory leak associated with it.

I expect B::Deparse is your friend for understanding things like this.
 If you don't know how to use it, there are lots of people on
perlmonks.org who love it.

- Perrin

Mime
View raw message