You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To improve the speed of mapping columns into objects, before mapping the bean is analysed and the most efficient code will be syntesised using ASM. This way the mapTo<>() implementation, in most cases, outperforms mapping code created by the kotlin compiler, since some null checks have been ommited.
The MappingBenchmark, mapping a result set of 500000 rows shows the following run times:
Manual mapping of the select took: 61 ms
Reflection mapping of the select took: 233 ms
Cold ASM mapping of the select took: 86 ms
Hot ASM mapping of the select took: 51 ms
Manual mapping refers to a standard kotlin implementation.
Reflection mapping refers to a mapping using kotlin reflection.
Cold ASM mapping refers to code being synthesized and then executed.
Hot ASM mapping refers code being cached and executed.
Using the SmallMappingBenchmark, mapping 30 beans, we get a impression of the initial overhead:
Manual mapping of the select took: 1120 us
Reflection mapping of the select took: 55562 us
Cold ASM mapping of the select took: 31021 us
Hot ASM mapping of the select took: 147 us
Stabillity
This libary is tested, but it most certainly contains bugs and has several limitations, use with caution.