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?
Archived Comments
Good question! Subscribing to find out what the answer is when someone smarter than me replies. :)
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.
(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.
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 :)
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.
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.