hibernate - 发布后优化基于 ORM 的模型

标签 hibernate optimization performance

我正在使用 Hibernate 来处理一个新项目,当我工作时,我意识到我对应用程序的最初愿景可能最终不会成为它的命运。我认为不会经常被请求(因此延迟加载)的数据可能最终会被 85% 的请求所需要。相反,我在假设需要的情况下加载的数据可能不会像我认为的那样经常需要。

是否有一些分析工具或分析 ORM 使用情况的方法(特别是:Hibernate)可以帮助我在达到临界质量后调整我的应用程序?

唯一想到的是编写一些模拟实际使用的 Selenium 脚本,并使用不同的配置进行负载测试。这似乎可行,但也感觉像是获取我所追求的信息的一种非常迂回的方式。一定有更好的方法...

最佳答案

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?



Hibernate 3 合集 statistics在运行时。可能值得一看。 hibernate 文档中有一节“Monitoring performance”。

The only thing that comes to mind is to write some Selenium scripts that mimic actual usage and do load testing with configurations. That seems like it might work but also feels like a very round-about way of getting the information I'm after.



您应该首先 try catch 一些真实的工作负载。然后弄清楚如何重现它。

否则,您仍然会有偏见,并可能产生实际上并不代表现实的负载。如果您无法捕获真实的工作负载,请与潜在的最终用户讨论以了解他们如何使用该应用程序,并确保您的场景尽可能接近真实的最终用户行为。

关于hibernate - 发布后优化基于 ORM 的模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2208064/

相关文章:

c++ - 在循环条件下调用 const-vector size() 似乎缺少优化

java - 关于性能和 Java 互操作性 : Clojure vs. Scala

java - 换号哪个好?使用或不使用临时变量?这有关系吗?

Java:成对对象的高效集合概念

java - JPA 序列生成器给出 Null 值

hibernate - 扩展表的 JPA 映射 View

java - 如何从 Log4j 中过滤特定的异常?

database - 优化数据库 - 修复

c++ - 分析 DLL/LIB 膨胀

hibernate - 在Hibernate中映射本地化的字符串-有什么最佳实践吗?