Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://926798]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2014-09-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls