Looking for ideas on ORM Optimization (Post Launch)

This post is more than 2 years old.

There are some really good blog entries out there on ColdFusion 9 and optimization (I suggest reading everything at Rupesh's blog). As a developer, you have multiple options for how your entities are configured, and how related data is loaded. I'm still coming to grips with those options and learning how to best use them. But here is my question. Are there tools out there that can monitor your ORM usage and report back suggestions for optimization? As an example, consider a Department object that has many Employees. You may decide to make that relationship lazy="extra" since you figure you will almost never need to get employees from a department. But imagine now it's three years down the road - your front end code has changed - and now you are almost always requesting that data. It would make sense to change that relationship (and maybe change fetch to select as well) - but how would you know that? Is there some tool out there that can notice how you are using your entities and then provide some guidance? Certainly you can log the SQL, but it may not be simple to go from that logged SQL to your business logic.

Are there any tools/suggestions/etc in this area?

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Archived Comments

Comment 1 by Adam Tuttle posted on 2/5/2010 at 7:53 PM

Good question! Subscribing to find out what the answer is when someone smarter than me replies. :)

Comment 2 by Joe Rinehart posted on 2/5/2010 at 7:59 PM

I can't say it's entirely scientific, but here's what I do. It's not that different from non-ORM.

1) Determine most used use cases. Pre-launch, I guess. Post-launch, I look at stats.

2) Script those cases via MXUnit.

3) Run those tests via JMeter (free load testing tool).

4) Use JMeter to figure out which of the most used use cases is also running slowly.

5) Find the most damaging bottleneck - not necessarily ORM! - and remove it.

Comment 3 by Joe Rinehart posted on 2/5/2010 at 8:01 PM

(Meant to add a bit more)

I then wash / rinse repeat. Some may call it too "reactive," but every time I've proactively optimized I end up overoptimizing myself into a world of hurt. Instead of optimizing everything, I try to cyclicly correlate what's not optimal with what's actually affecting people, using that to prioritize meaningful optimizations.

Comment 4 by Adam Tuttle posted on 2/5/2010 at 8:04 PM

Joe: Would you say that it's best to err on the side of too little or too much optimization pre-launch? Said another way: is it easier to remove unnecessary optimization, or add it in after the fact?

Aside from lazy-loading, what other optimizations can be made with ORM?

Please pardon my noob questions... I'm still learning ORM for the first time :)

Comment 5 by Alex Sante posted on 2/5/2010 at 8:37 PM

I'm also pretty new to this kind of stuff (optimization, load testing etc..), and have started using two tools. The first is actually an online tool called LOADSTORM (www.loadstorm.com). It a subscription based system, but also allows you to stress test your site for free (up to 50 virtual users). You can setup all kinds of test patterns. The second tool I started using recently is jRockit. I have it all setup and can see what's going on behind the scenes, but have not yet learned how to analyze the data.

Comment 6 by Drew posted on 2/6/2010 at 2:41 AM

I think he's asking for something like Cache Monitor for Transfer: http://docs.transfer-orm.co.... Cache Monitor models your ORM activity as it is being used on your site.

Looks like Adobe is letting Third Parties invent this.