perf(histogram): render the export list straight from the store iterator - #815
Open
milcho0604 wants to merge 1 commit into
Open
perf(histogram): render the export list straight from the store iterator#815milcho0604 wants to merge 1 commit into
milcho0604 wants to merge 1 commit into
Conversation
Drops two intermediate arrays per scrape. Numbers are in the prometheus#804 thread. Signed-off-by: Changhyun Kim <milcho0604@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Array.from cleanup you suggested after #804. Only one call site qualified. LabelMap.values() hands back the raw Map iterator, so the histogram export can map and reduce over it directly and both intermediate arrays go away. The other Array.from uses in lib feed the public API, which is typed as real arrays, or sit on cold paths, so I left those alone.
Measurements are in my earlier comment at #804 (comment). It helps 24 and 26 at high series counts and can cost a few percent on 22 under default heap settings. You called that acceptable for a major release with a note, so the CHANGELOG entry says exactly that.
I verified the rendered output is byte identical to main on 22, 24 and 26, and the suite passes on all three.