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

Make Cache.Get allocation-free #162

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

yiftachkarkason
Copy link
Contributor

Changes

  • Changed applyOptions and the Option[K,V] to be non-allocating by avoiding pointers
  • Added the Test_Get_DoesNotAllocate to make sure that Get does not allocate (it fails before this commit)

Why
We encountered a performance issue when we heavily used the Cache, and narrowed it down to the allocation made by Cache.Get as part of the options processing.

Thank you for the great package!

Copy link
Contributor

@davseby davseby left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution.

Changed applyOptions and the Option[K,V] to be non-allocating by avoiding pointers

Added the Test_Get_DoesNotAllocate to make sure that Get does not allocate (it fails before this commit)
Copy link
Contributor

@swithek swithek left a comment

Choose a reason for hiding this comment

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

I think we can merge this? @davseby

Well done @yiftachkarkason

@coveralls
Copy link

coveralls commented Feb 6, 2025

Pull Request Test Coverage Report for Build 13180247307

Details

  • 21 of 21 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 99.416%

Totals Coverage Status
Change from base Build 12845347580: 0.006%
Covered Lines: 681
Relevant Lines: 685

💛 - Coveralls

@davseby davseby merged commit ac93db9 into jellydator:v3 Feb 6, 2025
2 checks passed
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.

4 participants