Hi Andi,

On Saturday, January 4, 2020 at 8:28:14 AM UTC+1, andi wrote:
>
> Hi together and a happy new year.
>

Happy new year to you, too. 

First, i am really impressed by Jooq and we used it in the project for 1 
> year now. (powerfull and easy)
>

Thanks for the kind words.
 

> Now the project is more mature and it comes to optimication. 
> As it is a number crunching project we must not have wrapped datatypes, 
> because it leads to a lot auf auto(un)boxing and slows down performance.
> Is there a way, that jooq generates the pojos with primitive types for 
> nonnull values? (float instead of Float)
>

I assume you are using POJOs in order to be able to use methods like 
ResultQuery#fetchInto(Class) and Record#into(Class), which behind the 
scenes rely on jOOQ's RecordMapper.

jOOQ's default DefaultRecordMapper implementation cannot fully support 
primitive types in a generic way, as there would be no way to distinguish 
null values from the primitive type's default value (e.g. 0L for long). 
There was a recent related discussion which may also help to understand the 
problem: https://github.com/jOOQ/jOOQ/issues/9704#issuecomment-570514225.

Please also note that a generic RecordMapper implementation would be 
expected to use reflection to call setter methods, and when 
Method#invoke(Object, 
Object...) gets called you would already there have some autoboxing. So a 
custom RecordMapper implementation would also not fully alleviate this 
issue.

To optimize for performance I think you will in a first step want to 
optimize the SQL query and in a second step also review your JDBC 
parameters, which for many databases can have a big impact performance. But 
I assume you have already done that.

To further maximize performance for a given query you may want to go down 
to the JDBC level and do the POJO mapping for the query manually, which you 
can achieve by using ResultQuery#fetchResultSet() which returns a plain 
JDBC ResultSet. With performance testing you will then be able to establish 
how much this improves things.

Hope this helps,
Knut

-- 
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 jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/fd56ee6b-c314-47a0-be9e-1f3230c31ab1%40googlegroups.com.

Reply via email to