[rt-devel] [PATCH] RT::Require faster implementation of eval "require ...".

Jesse Vincent jesse at bestpractical.com
Mon Mar 29 17:56:40 EST 2004


On Mar 29, 2004, at 1:19 AM, Ruslan U. Zakirov wrote:

> Jesse Vincent wrote:
>> On Sat, Mar 27, 2004 at 09:13:50PM +0300, Ruslan U. Zakirov wrote:
>>> 	Hello.
>>> Attached patch represent new function RT::Require which implement
>>> eval "require $module". This implementation check "$module::VERSION"
>>> before running eval.
>>>
>>> It shows that my code runs ~3 times faster when module allready 
>>> loaded.
>> Is this change just because it's "neat" or because you've actually run
>> into a measurable delay with the current method? To my knowledge, RT
>> doesn't do any "require"s in a tight loop. From your perf tests, it
>> looks like the standard method is already pretty fast, relative to
>> everything else that RT's doing.
>
> 1) it's neat. May be only for me.
> 2) it could be used not only while other dynamic loading.
> 3) it checks existence before evaling, it's better in any case.
> 4) I don't think that this case when features are more bad then good.
> 5) You could skip it in any case.

*nod* If it actually provides a performance improvement over eval 
without any downside, then it probably makes sense as a CPAN module or 
possibly a perl core patch.


> 			Best regards. Ruslan.
>> 	Best,
>> 	Jesse
>




More information about the Rt-devel mailing list