[Dbix-class] Molesting Schemas

Christopher H. Laco claco at chrislaco.com
Wed Jun 7 19:22:50 CEST 2006


Matt S Trout wrote:
[snip]
>> This works, but it appears to cause quite the performance issue when
>> calling load_components() on the new classes. The performance issue
>> appears to go away if I call load_components either before
>> compose_namespace, or on the schema class, and not on a connected schema
>> object.
>>
>> Is there a better way to get at entires rows before update/insert calls,
>> other than loading components into the result sources?
>>   
> The issue is load_components calling C3 re-init every time, which can be
> quite expensive. If you're making multiple load_components calls, do
> 
> Class::C3->uninitialize;
> $Class::C3::TURN_OFF_C3 = 1;
> <do all your component faffing here>
> $Class::C3::TURN_OFF_C3 = 0;
> Class::C3->reinitialize;
> 
> that way you'll only take the time hit once.
> 
> 

Oddly, $Class::C3::TURN_OFF_C3 will take my changes, but the block of
code is just as slow, if not slower than not using
uninitialize/reinitialize.

I'd suspect than that my speed issue is just as much
load_components->_load_components->inject_base() now.

-=Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060607/9b543de3/attachment.pgp 


More information about the Dbix-class mailing list