I’m using Hibernate to work on a new project, and as I work I’m realizing that my original vision for the application may not end up being its destiny. Data that I think is not going to be often requested (and thus lazy-loaded) might end up being needed for 85% of requests. Conversely, data that I’m loading under the assumption it will be needed might turn out to not be needed as often as I think it will.
Is there some profiling tool or method of analyzing ORM usage (specifically: Hibernate) that can help me tune my application after it has reached critical mass?
The only thing that comes to mind is to write some Selenium scripts that mimic actual usage and do load testing with different configurations. That seems like it might work but also feels like a very round-about way of getting the information I’m after. There has to be a better way…
Hibernate 3 gather statistics at run-time. Might be worth having a look. There is a section “Monitoring performance” in the hibernate doc.
You should try first to capture some real workload. Then figure out how to reproduce it.
Otherwise you will still be biased and may generate a load that actually doesn’t represent the reality anyway. If you can’t capture a real workload, then discuss with potential end-user to see how they use the app and make sure your scenario are as close as possible to the real end-user behavior.