eXsio / querydsl-entityql

QueryDSL EntityQL - Native Query builder for JPA
MIT License
118 stars 16 forks source link

Benchmarks measure overhead of acquiring a connection or setting up EntityManager #9

Open lukaseder opened 3 years ago

lukaseder commented 3 years ago

I came here from a reddit discussion: https://www.reddit.com/r/java/comments/o2z0yu/hibernate_community_performance_comparison_with/h2aqdjx?utm_source=share&utm_medium=web2x&context=3

I think these resource management lines should be moved out of the benchmark into the setup section:

https://github.com/eXsio/querydsl-entityql/blob/fb6155328fa0f6d571138076b30aab717a40e8d3/src/test/java/pl/exsio/querydsl/entityql/java/benchmark/execution/jdbc/JDBCQueryExecutionBenchmark.java#L39

https://github.com/eXsio/querydsl-entityql/blob/fb6155328fa0f6d571138076b30aab717a40e8d3/src/test/java/pl/exsio/querydsl/entityql/java/benchmark/execution/jpa/JpaJPQLQueryExecutionBenchmark.java#L34

Or, at least, create a separate benchmark that allows for seeing how much overhead is produced by this resource management.

I don't know your product, but I'm assuming this overhead is already being moved to the setup section when you measure your own product: https://github.com/eXsio/querydsl-entityql/blob/master/src/test/java/pl/exsio/querydsl/entityql/java/benchmark/execution/entityql/EntityQLDynamicQueryExecutionBenchmark.java

eXsio commented 3 years ago

Hi Lukas!

Thanks for noticing this, you are absolutely correct. I will update the benchmarks and post the new results.