开发者

Which Java ORM is considered the most performant generally speaking? [closed]

开发者 https://www.devze.com 2022-12-27 12:49 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 8 years ago.

开发者_StackOverflow Improve this question

Which Java ORM is considered the most performant generally speaking?

I realize this could mean less features, but just want an idea.


A few years ago, at the place I was working, we spend some time comparing the performance of plain JDBC, Hibernate, TOPLink and Weblogic CMP for typical usecases (fetch, updates, join fetches, partial fetches etc). Hibernate, TOPLink or Weblogic CMP did not add any significant overhead over plain JDBC. Hibernate had a minor performance issue, but that turned out to be a bug in Oracle's driver (and the team implemented a workaround too).

Having said that, I should add that making these tools perform well was non-trivial - one should have a good understanding of what is happening under the covers and be familiar with the configuration parameters. Also, it is very easy to generate bad queries (N+1 problems, for example) with ORMs.

Eventually we chose Hibernate because we liked its programing model (it is very non-intrusive) better and because it was free (as in beer).


Define performance ? Performance on the typical operations that your operations requires would make most sense, so it is for you to define your persistence layer operations. JDO is the most configurable standardised API, whilst JPA is most commonly used (with little opportunity to tune it). DataNucleus provides both. If you have operations like PolePosition benchmark then DataNucleus performs very well relative to the competing solutions (with tuning on all); but then that benchmark doesn't necessarily perform your typical operations.


Ujorm claims to be the most performant. Honestly, I've never heard about it before, Google just popped it.

Regardless, it depends on the environment and the functional requirements. Measuring is knowing. I wouldn't expect the differences being shocking huge. All self-respected ORM frameworks and implementations can be tuned to extreme. I would after all prefer a known, clear and concise API above an obscure API and performance. As far now JPA(2) excels in this.


I would second the vote on Hibernate as the most popular ORM out there for Java. It performs well and is quite mature. I would caution you to consider that other issues probably bury ORM performance issues. That is, the ORM is usually not going to be your bottleneck assuming you configure and use it properly.


The problem with your question is the "generally speaking". There is no such thing, there is no "general" application. Each application has its own object model and requests and the performances obtained with one particular ORM wouldn't be necessarily transposable to another application (in other words, another application may perform better with another ORM solution).

So, if you want to find an answer to your question, bench the various ORMs on your application. This is not so hard to do if you're using JPA and if you're not using proprietary extensions (note that changing the JPA provider doesn't prevent you from having to tune it). It will require more efforts to include other ORM solutions.


Hibernate is by far the most popular option. This is particularly nice when requiring support from a very large community. However, it also has its shortcomings -- like batch inserts. It really depends on what you're looking to do and what kind of performance you need. In general Hibernate is very fast.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号