refactor(bench): parallelize benchmark report builder#1990
Merged
numinnex merged 7 commits intoJul 10, 2025
Conversation
Contributor
|
LGTM, Good job! |
numinnex
approved these changes
Jul 10, 2025
spetz
approved these changes
Jul 10, 2025
Contributor
|
Looks solid, thanks! |
hageshiame
pushed a commit
to hageshiame/iggy
that referenced
this pull request
Nov 7, 2025
## Description Currently, the build() method from BenchmarkReportBuilder is single-threaded. This PR parallelizes this in 3 places: 1. In build(), spawn a new thread for every call to `from_individual_metrics` or `from_producers_and_consumers_statistics`. 2. In calculating aggregated time series, spawn one thread for each time series (MB, msg, latency). 3. In TimeSeriesCalculator, use rayon parallel iterators. (I also tried implementing multithreading and `par_iter`s in other places, but those led to slower performance, likely due to threading overhead. Those are not included in the PR.) ## Measuring speedup I measured the average runtime of build() with 200 producers and 200 consumers on a Ryzen 9 7950X with 124 GB RAM. build() shows between 3.7-11x speedup, with greater speedup for greater message loads. | Message count | Single-threaded runtime (ms) | Multi-threaded runtime (ms) | Speedup | | ------------- | ---------------------------- | --------------------------- | ------- | | 8M messages | 155 | 42 | 3.7x | | 16M messages | 497 | 74 | 6.7x | | 32M messages | 1791 | 162 | 11.0x | Closes apache#1976
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.

Description
Currently, the build() method from BenchmarkReportBuilder is single-threaded. This PR parallelizes this in 3 places:
from_individual_metricsorfrom_producers_and_consumers_statistics.(I also tried implementing multithreading and
par_iters in other places, but those led to slower performance, likely due to threading overhead. Those are not included in the PR.)Measuring speedup
I measured the average runtime of build() with 200 producers and 200 consumers on a Ryzen 9 7950X with 124 GB RAM. build() shows between 3.7-11x speedup, with greater speedup for greater message loads.
Closes #1976