-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize dpgSignature function in Prometheus receiver
This function is invoked very often, which leads to high CPU usage when collecting Prometheus metrics. Benchmark results on my machine show 3x less CPU and almost 4x less memory used. Since I'm also changing the format of returned values (dropping superfluous characters), it will reduce overall memory usage of the receiver, because they are used as map keys. Benchmark result before this change: Benchmark_dpgSignature-6 1284531 969.6 ns/op 120 B/op 7 allocs/op Benchmark result after this change: Benchmark_dpgSignature-6 3515179 313.9 ns/op 32 B/op 2 allocs/op
- Loading branch information
Showing
2 changed files
with
31 additions
and
9 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
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