[Dbix-class] DBIx::Class and caching

Ash Berlin ash_cpan at firemirror.com
Thu Jul 3 13:15:10 BST 2008


On 3 Jul 2008, at 12:57, Oleg Pronin wrote:

> DBIx::Class::Cursor::Cached is too slow for production use. It  
> caches only data from DB making it impossible so store virtual data  
> in objects and after fetching data from cache it has to construct a  
> row object which is a expensive action for CPU, running all the  
> 'inflate_result', and possibly other hard tasks.
>
> When you use DBIC::C::C - it slows down the request by 2 times  
> (based on local CPU usage - not DB).
>
> With solution i posted, request is 3-4x faster than original for  
> local CPU.
>
> 2008/7/3 Andreas Pronakis <andr3as at yahoo.com>:
> I was wondering if anyone has tried using the module  
> DBIx::Class::Cursor::Cached but replacing the cache engine  
> Cache::FileCache with Memcache?
>
> I will try it out and let you know the results, but if someone else  
> has already tried it would be nice to know what their findings were
>
> Andreas
>
>
> --- On Wed, 6/25/08, Oleg Pronin <syber.rus at gmail.com> wrote:
>
> > From: Oleg Pronin <syber.rus at gmail.com>
> > Subject: Re: [Dbix-class] DBIx::Class and caching
> > To: andr3as at yahoo.com, "DBIx::Class user and developer list" <dbix-class at lists.scsys.co.uk 
> >
> > Date: Wednesday, June 25, 2008, 9:23 AM
> > These approach caches ready objects, not just a data from
> > database, so it
> > quite fast, and lets you to cache any data with object,
> > even not from DB.
>

Please don't spread FUD.

Yes you can't store virtual data with Cursor::Cached, but then I'd  
argue that you shouldn't be doing that anyway.

And no it doesn't have to construct a row object if you don't want to  
See <http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/ResultClass/HashRefInflator.pm 
 > . Yes object construction can be expensive, but its what you want  
most of the time. If you dont want objects don't use an ORM. (The 'O'  
there stands for Object, dontcha know.)

Which solution? Link to archives please.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080703/8e41d2b7/attachment.htm


More information about the DBIx-Class mailing list