Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jdbc.read] Properly pre-compute column fetching thunk #189

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

alexander-yakushev
Copy link
Contributor

Thanks to your comment on #179 I finally understood what is the deal with column thinks and such. This PR moves computing the thunk to where it should be – outside of the returned lambda, so that the machinery is not re-run for every row. The benchmark from #185 gives this:

master (results are reused):
Time per call: 18.89 ms   Alloc per call: 17,484,278b
Time per call: 18.90 ms   Alloc per call: 17,483,998b
Time per call: 18.87 ms   Alloc per call: 17,483,817b

After PR:
Time per call: 9.83 ms   Alloc per call: 11,968,423b   Iterations: 209
Time per call: 9.99 ms   Alloc per call: 11,968,262b   Iterations: 201
Time per call: 9.76 ms   Alloc per call: 11,968,255b   Iterations: 209

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.57%. Comparing base (352d181) to head (5b14028).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
- Coverage   83.58%   83.57%   -0.01%     
==========================================
  Files          37       37              
  Lines        2497     2496       -1     
  Branches      212      212              
==========================================
- Hits         2087     2086       -1     
  Misses        198      198              
  Partials      212      212              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@camsaul camsaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, that was 100% the way it was supposed to work in the first place. Thanks for catching this

@camsaul camsaul merged commit 913ff6a into camsaul:master Oct 14, 2024
10 checks passed
@alexander-yakushev alexander-yakushev deleted the pre-compute-thunk branch October 14, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants