As you suspected, there was something wrong with my timing code. Here's a more formal comparison for a query returning a single record. It is much better. I'm not surprised that JPA is faster given that it is using a pre-parsed query with @NamedQuery. I'm getting some weird overhead with @Transactional and JOOQ that I need to figure out. For what it's worth, when the number of records returned is around 250 the difference between the two disappears.
JOOQ-NP means no-parse, just sending a query string and processing Results. JOOQ-RS does a parse like JOOQ but processes a ResultSet directly instead of a JOOQ Result object. JPA (avg=755.4us, total=3.776s, samples=4998, ops=1323.97) JOOQ (avg=824.4us, total=4.121s, samples=4998, ops=1213.11) JOOQ-NP (avg=790.1us, total=3.949s, samples=4998, ops=1265.64) JOOQ-RS (avg=821.9us, total=4.108s, samples=4998, ops=1216.65) -- JPA is 9.14% faster than JOOQ -- JOOQ-NP is 4.33% faster than JOOQ -- JOOQ-RS is 0.29% faster than JOOQ On Thursday, January 8, 2015 at 11:15:13 PM UTC-8, Lukas Eder wrote: > > > > 2015-01-09 1:03 GMT+01:00 Robert DiFalco <[email protected] > <javascript:>>: > >> I just did a little performance testing. >> >> FWIW, using Record is about 100ms per query slower than ResultSet. >> >> But worse yet using DSLContext is about 250ms slower than raw Connection >> for a simple joined query. For Hibernate/JPA, using a NamedNativeQuery is >> about the same time as using a raw JDBC connection and about 300ms faster >> than JOOQ. >> > > For a single query? That would be extremely surprising, or perhaps, > specific to a particular API usage that might be out of the ordinary. It > would be interesting to see this in action with a sample project... > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
