Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Hardware to run heavy dbix::class stuff?

by chrestomanci (Priest)
on Sep 19, 2011 at 19:47 UTC ( #926798=note: print w/replies, xml ) Need Help??

in reply to Hardware to run heavy dbix::class stuff?

I think you are taking the wrong approach. If you do thing right then most of the heavy lifting should take place inside your relational database engine (MySQL in this case).

As you said, there is a large performance penalty when DBIx::Class creates objects from rows in the database. This is a known bottleneck with any Object relational mapper. It exists because by choosing to use DBIC, you have traded a little performance for convenience. It is hitting you hard because you have created lots of objects.

What I think you should be doing is designing your database schema, and writing better queries so that DBIC only inflates the objects you really need. For example could you pre-calculate some stuff and store it as extra rows in your database so that calculations happen faster? Could you indexes or views to your database to further speed things up?

Once you have succeeded in shifting the load to MySQL, then your problem will become one of optimising the performance of that database, which is not something we are expert in, though I suspect that by the time you reach that stage, you will have gained acceptable performance as you will have eliminated the DBIC object inflation penalty.

  • Comment on Re: Hardware to run heavy dbix::class stuff?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://926798]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2018-04-27 01:51 GMT
Find Nodes?
    Voting Booth?