camsaul / toucan2

Successor library to Toucan with a modern and more-extensible API, more consistent behavior, and support for different backends including non-JDBC databases and non-HoneySQL queries. Currently in active beta.
Eclipse Public License 1.0
81 stars 11 forks source link

[jdbc.row] Reduce allocations in fetch-all-columns! #190

Closed alexander-yakushev closed 1 month ago

alexander-yakushev commented 1 month ago

This doesn't look much like an improvement but it actually removes two sources of allocations per each row – the LongRange and the lambda created by partial. This accounts for ~10% of allocations in my "select 10k rows" benchmark, and it costs nothing to optimize it (except maybe a bit of readability).

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.59%. Comparing base (352d181) to head (b644d7b). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #190 +/- ## ========================================== + Coverage 83.58% 83.59% +0.01% ========================================== Files 37 37 Lines 2497 2499 +2 Branches 212 212 ========================================== + Hits 2087 2089 +2 Misses 198 198 Partials 212 212 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.