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

Switch caching package's interface to be generic and add experimental flag to try different caches #1990

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

josephschorr
Copy link
Member

Fixes #1979

@github-actions github-actions bot added area/CLI Affects the command line area/api v1 Affects the v1 API area/datastore Affects the storage system area/dependencies Affects dependencies area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) area/dispatch Affects dispatching of requests area/api http Affects the HTTP Gateway API labels Jul 20, 2024
vroldanbet
vroldanbet previously approved these changes Jul 22, 2024
Copy link
Contributor

@vroldanbet vroldanbet left a comment

Choose a reason for hiding this comment

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

Changes LGTM

pkg/cache/cache_theine.go Outdated Show resolved Hide resolved
"github.com/rs/zerolog"
)

func NewTheineCacheWithMetrics[K KeyString, V any](name string, config *Config) (Cache[K, V], error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not also add otter as an option so we can test side-by-side? or did you look at both and decide theine was a clear winner?

Copy link
Member Author

Choose a reason for hiding this comment

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

Otter's own README shows it is less performant for DB-like services. We could always add it as a followup

Copy link
Contributor

@ecordell ecordell Jul 22, 2024

Choose a reason for hiding this comment

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

I just don't see how we'll know without testing both. Otter's benchmarks look better for everything except 100% writes

Copy link
Member

Choose a reason for hiding this comment

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

let's add both and blog about it

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

pkg/cache/cache.go Show resolved Hide resolved
@josephschorr josephschorr force-pushed the cache-improvements branch 2 times, most recently from d66e77d to 84a622e Compare July 25, 2024 17:53
@josephschorr josephschorr marked this pull request as ready for review July 25, 2024 17:53
@josephschorr josephschorr requested a review from a team as a code owner July 25, 2024 17:53
@josephschorr josephschorr changed the title Switch caching package's interface to be generic and add experimental flag to try Theine cache Switch caching package's interface to be generic and add experimental flag to try different caches Jul 25, 2024
ecordell
ecordell previously approved these changes Jul 25, 2024
@josephschorr josephschorr added this pull request to the merge queue Jul 25, 2024
Merged via the queue into authzed:main with commit 383a05f Jul 25, 2024
22 checks passed
@josephschorr josephschorr deleted the cache-improvements branch July 25, 2024 18:28
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api http Affects the HTTP Gateway API area/api v1 Affects the v1 API area/CLI Affects the command line area/datastore Affects the storage system area/dependencies Affects dependencies area/dispatch Affects dispatching of requests area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Evaluate replacing ristretto with theine-go
4 participants