Reuse profile rewriter during ingestion
- Dominant language
- Go
- Stars
- 11.7k
- Forks
- 802
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 80
Description
When ingesting pprof profiles, we need to remap most IDs to already ingested symbols.
Right now the code creates a new set of rewriter maps for each symbols types. (strings, functions, locations, mapping, stacktraces)
https://github.com/grafana/phlare/blob/7d20115c15e650afc60bc4c0334b403e2550e434/pkg/phlaredb/deduplicating_slice.go#L177
Those are then added kept for the scope of the request using:
https://github.com/grafana/phlare/blob/7d20115c15e650afc60bc4c0334b403e2550e434/pkg/phlaredb/deduplicating_slice.go#LL228C15-L228C15
To rewrite further symbols ids encountered.
https://github.com/grafana/phlare/blob/7d20115c15e650afc60bc4c0334b403e2550e434/pkg/phlaredb/deduplicating_slice.go#LL182C2-L186C3
Because we expect at some point to rewrite everything we should probably use arrays of the size of the input slice that can be re-used via a `sync.Pool`. Ultimately I think we should pool and reuse rewriters. We should have a different pool for each type though since the size of each types varies a lot.
For example we expect thousands of stracktraces, but only few mappings.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.