[Dbix-class] Modifying DBIx::Class::Core (collapsing classes)

Matt S Trout dbix-class at trout.me.uk
Mon Oct 23 17:25:12 BST 2006


John Napiorkowski wrote:
> --- Matt S Trout <dbix-class at trout.me.uk> wrote:
> 
>> Basically, the reason I've been asking about this is
>> that next::method is 
>> approx 2*sub call plus a hash lookup overhead (note
>> sub call, method calls are 
>> marginally more expensive than sub calls).
>>
>> Given nobody seems to be using the component in
>> isolation, I was wondering 
>> about collapsing any next::method stuff into a
>> single method, probably in Row. 
>> This would make exactly zero difference if
>> everybody's only subclassing Core, 
>> but would probably give us a noticeable performance
>> improvement.
>>
>> Thoughts? Comments? Objections?
> 
>>From what I can see the main advantage to the way it
> is now is that by breaking it up a bit it can help
> with code updates and for understanding how it works. 
> If you don't think doing this would make it more
> difficult in the long run I don't see any downside at
> all, and speedups are a definate plus since that's the
> big objection I'm getting from some of my clients
> (although a lot of it is due to things I need to
> optimize, like using prefetch instead of join in
> certain places, etc.)

It shouldn't be a big deal. I broke it all out as much as possible when I 
first wrote it so we had room to turn on a dime architecture-wise if required 
(remember it was supposed to be a research project at that point ;).

This won't make any diff to ResultSet speed, but it *will* make a difference 
to row object instantiation and use, and that's where we're noticeably slow 
atm. It'll also give me a chance to move the architecture around a bit in such 
a way we can split it more naturally for certain other things I have planned 
later, I hope.

My Cunning Plan is to hack stuff to pieces in a branch off current, see 
whether it provides the improvements i'm hoping for, and if it does let people 
have a look over it before we merge it back.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the DBIx-Class mailing list