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

Use sequences instead of sets #13

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Conversation

Baptouuuu
Copy link
Member

@Baptouuuu Baptouuuu commented Feb 11, 2024

Problem

Sets are used to describe a unique collection of properties, entities, etc... Even though this is the right structure conceptually, it adds lots of operations to make sure there are no duplicated objects. But the way the objects are created there can never be multiple instances of the same object inside a collection.

The result is that the time took to verify this unicity is wasted and impacts the overall performance of the ORM.

Solution

Replace Sets by Sequences.

Result

When running the benchmark script to list 100k aggregates this PR results in 19% time reduction:

Screenshot 2024-02-12 at 19 04 06

@Baptouuuu Baptouuuu self-assigned this Feb 11, 2024
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f9275d5) 97.64% compared to head (d410a67) 97.62%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop      #13      +/-   ##
=============================================
- Coverage      97.64%   97.62%   -0.02%     
  Complexity       470      470              
=============================================
  Files             78       78              
  Lines           3182     3160      -22     
=============================================
- Hits            3107     3085      -22     
  Misses            75       75              

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

@Baptouuuu Baptouuuu marked this pull request as ready for review February 12, 2024 18:05
@Baptouuuu Baptouuuu merged commit cd95f30 into develop Feb 12, 2024
15 checks passed
@Baptouuuu Baptouuuu deleted the replace-sets-by-sequences branch February 12, 2024 18:15
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.

1 participant