-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(metrics): Improve distribution value performance (#2483)
Represents distribution metrics as plain unsorted vectors instead of deduplicated btree maps. This offers greatly improved performance characteristics during insertion, but comes at the expense of potentially more memory usage if there are a lot of duplicate values. During benchmarks, this change reveals approximately 500x speedup for metrics with 10k to 1M data points per bucket. In practice, large buckets are much more prevalent than duplicate values. The new implementation uses `SmallVec`. Since distribution values are always stored within a `BucketValue` that also contains gauges. Since `GaugeValue` is a larger struct, that leaves space to inline three float values before allocating a vector for distributions. Usual production traffic indicates that this covers the majority of distribution buckets, so this is a worthwhile optimization.
- Loading branch information
Showing
15 changed files
with
305 additions
and
683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.