-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
perf: Re-introduce fixed size memory pool for bloom querier #13172
Conversation
2cc9507
to
9ee6b31
Compare
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@@ -18,6 +23,7 @@ type Config struct { | |||
BlocksCache BlocksCacheConfig `yaml:"blocks_cache"` | |||
MetasCache cache.Config `yaml:"metas_cache"` | |||
MetasLRUCache cache.EmbeddedCacheConfig `yaml:"metas_lru_cache"` | |||
MemoryManagement MemoryManagementConfig `yaml:"memory_management" doc:"hidden"` |
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.
Explicitly hide this config from the docs.
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. Left a nit.
// While bloomStoreEntry implements the Store interface, this method must never | ||
// be used directly and therefore can safely return nil. | ||
func (b *bloomStoreEntry) Allocator() mempool.Allocator { | ||
return nil |
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.
nit: I think would be better to no having to satisfy the interface in this way. Maybe we can have
type StoreWithAllocator interface {
Store
Allocator() mempool.Allocator
}
Ans only BloomStore
implements that.
Having said that, if we don't want to do this, I think we should rather panic here.
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 idea. I will add the interface.
Move `Allocatior()` function from base interface to "extended" store interface, like it was done for `BloomMetrics()`. Additionally renamed `Store` to `StoreBase` (which is implemented by all stores, also the individual store entries) and `StoreWithMetrics` to `Store`, because this is the main interface that is used. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
What this PR does / why we need it:
This PR re-introduces the fixed size memory pool that was originally introduced with #13039 but reverted with #13162
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR