Don't ask to ask, just ask | |
PerlMonks |
Re^7: Removing AUTOLOAD from CGI.pm (closure vs eval)by LanX (Saint) |
on Feb 24, 2015 at 14:19 UTC ( [id://1117657]=note: print w/replies, xml ) | Need Help?? |
> I'm sure compilation speed shouldn't matter when generating closures. (I will add a benchmark later this day) Here a simplified example which showed that installing subs with closures¹ is 5 times faster than eval. That's less dramatic than I thought, but eval performance also heavily depends on the length of code. So adding 10 no-ops already made eval 10 times slower while closure didn't change.
output:
One has to keep in mind that 15-20 years ago machines were factor 1000 slower, i.e. auto loading was relevant.
updatefixed bug with no-ops. ¹) currying to be precise
In Section
Perl News
|
|