-
Notifications
You must be signed in to change notification settings - Fork 67
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
Introduce support for per-call memory allocator for caching #249
Conversation
This change adds the ability to pass a memory allocator to caching methods via their context argument. This allows the underlying client to use memory allocators better suited to their workloads than GC. This is only used by the Memcached client at the moment. See grafana/mimir#3772 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
808a61b
to
829f347
Compare
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
This approach currently uses a |
My 2c: I would prefer an Rationale: As a consumer of this library, an Using parameters would also help avoid annoying bugs - for example, imagine a scenario where we had a couple of different libraries that all expected the allocator to be passed in the |
That's a great point: that would make the API much harder to use incorrectly. I'll work on that change tomorrow. |
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, LGTM! I just left a nit.
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
server: Expose `http` and `grpc` listen addresses.
What this PR does:
This change adds the ability to pass a memory allocator to caching methods using one or more
Option
arguments. This allows the underlying client to use memory allocators better suited to their workloads than GC. This is only used by the Memcached client at the moment.Which issue(s) this PR fixes:
See grafana/mimir#3772
See grafana/gomemcache#8
Signed-off-by: Nick Pillitteri nick.pillitteri@grafana.com
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]