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

perf: Improve performance of the apply changes method by grouping rows. #88

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

bvanelli
Copy link
Owner

@bvanelli bvanelli commented Oct 20, 2024

Improves the speed when having thousands of entries on the sync backlog by grouping them together. This should make sure that the inserts are done in a single query (INSERT ... ON CONFLICT UPDATE), but should also newly created entities fields together, making the queries more efficient. Over testing, this helped improve performance of budget with high number of entries high, but also keep the performance of newly created budgets (without many changes) the same.

Closes #87

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.67%. Comparing base (0e391ee) to head (13f4dad).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #88   +/-   ##
=======================================
  Coverage   97.66%   97.67%           
=======================================
  Files          16       16           
  Lines        2188     2194    +6     
=======================================
+ Hits         2137     2143    +6     
  Misses         51       51           

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

@bvanelli bvanelli merged commit 68d640d into main Oct 21, 2024
8 checks passed
@bvanelli bvanelli deleted the perf/improve-apply-changes-performance branch October 21, 2024 19:07
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.

__init__::apply_changes appears to be very slow with many TX
1 participant