[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stupid optimization question


On 5/17/07, Jonathan Vanasco <suppressed> 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


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.