我想为我的Java Web项目使用jooq,因为从它的规范来看,它看起来像是简单而又好的查询生成器,但是相对于Java中的简单查询或预备语句,它没有任何性能提升。
There are ongoing (unpublished) benchmarks checking for bottlenecks and general performance issues in jOOQ. An example of a recently discovered issue can be seen here:
https://github.com/jOOQ/jOOQ/issues/1625
As Mikko stated as well , jOOQ cannot beat static SQL strings passed to JDBC directly, as you will always have the overhead of:
PreparedStatement
with that SQL PreparedStatement
If performance is critical in your environment, I suggest you do not let jOOQ perform these steps for every query execution. Instead, let jOOQ render SQL once and cache the SQL string yourself, as well as a reference to the reusable PreparedStatement
. However, if you're not using an in-memory database, such as H2, we're talking about micro-optimisation here, as shown in the benchmark. We're talking about gaining < 1ms per query.
No, it does not offer performance gain. JOOQ itself communicates with database over JDBC (and uses prepared statements) and does not contain cache, so it simply cannot be faster than executing queries over JDBC directly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.