Skip to content

perf(histogram): render the export list straight from the store iterator - #815

Open
milcho0604 wants to merge 1 commit into
prometheus:mainfrom
milcho0604:perf/iterator-helpers-histogram
Open

perf(histogram): render the export list straight from the store iterator#815
milcho0604 wants to merge 1 commit into
prometheus:mainfrom
milcho0604:perf/iterator-helpers-histogram

Conversation

@milcho0604

Copy link
Copy Markdown
Contributor

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.

Drops two intermediate arrays per scrape. Numbers are in the prometheus#804 thread.

Signed-off-by: Changhyun Kim <milcho0604@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant