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

Refactor polymorphic keys method #941

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

tagliala
Copy link
Contributor

Use select instead of map.compact to:

  • Eliminate unnecessary object creation and array compaction
  • Maintain identical functionality
  • Improve readability and performance
Comparison (IPS):
                keys:  1716164.8 i/s
            keys_old:  1531182.7 i/s - 1.12x  (± 0.00) slower

Comparison (Memory):
                keys:        120 allocated
            keys_old:        160 allocated - 1.33x more

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.92%. Comparing base (532288b) to head (6600487).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #941   +/-   ##
=======================================
  Coverage   98.92%   98.92%           
=======================================
  Files          14       14           
  Lines         557      557           
=======================================
  Hits          551      551           
  Misses          6        6           

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

Use `select` instead of `map.compact` to:
- Eliminate unnecessary object creation and array compaction
- Maintain identical functionality
- Improve readability and performance

```
Comparison (IPS):
                keys:  1716164.8 i/s
            keys_old:  1531182.7 i/s - 1.12x  (± 0.00) slower

Comparison (Memory):
                keys:        120 allocated
            keys_old:        160 allocated - 1.33x more
```
@tagliala tagliala force-pushed the chore/use-select-instead-of-map-compact branch from 17e48bd to 6600487 Compare October 12, 2024 20:32
@tagliala tagliala requested a review from javierjulio October 12, 2024 20:35
Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

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

Thanks!

@tagliala tagliala merged commit 2e89044 into master Oct 13, 2024
22 checks passed
@tagliala tagliala deleted the chore/use-select-instead-of-map-compact branch October 13, 2024 07:32
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