You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Benchmarks in MR/PR: List differences to main branch #839
Maybe this feature exists, and I just can't find it in the docs:
I am running benchmarks on bencher.dev's bare-metal runners for my main branch. For merge requests, I have a manual job that can be started to check the performance changes the merge request brings. However
The output does not give me a comparison of the performance changes towards the main branch. --start-point sounds like the thing to use ("Historical Metrics and optionally Thresholds are copied over from the Start Point."). But I still don't get a comparison in the output of bencher run
I also don't want to store the benchmarks for MRs permanently, so I'm not sure what to supply as a --branch because no matter what I supply, it will be stored under that branch permanently.
The bencher run output links me to the isolated results of the run. But I would like to have an overview of all results, in comparison to the main branch. Maybe as graphs with the new merge request data point marked?
The goal is to post these results as comment in GitLab, which is trivial to add as a curl command if I have the output from bencher. The GitLab metrics report would probably solve all my issues, but GNOME runs the free version of GitLab, which doesn't have the feature.
I am running benchmarks on bencher.dev's bare-metal runners for my main branch.
The only difference for Bencher Bare Metal is that you'll need to include the --image option. Otherwise, bencher run should work just the same as a local run.
The goal is to post these results as comment in GitLab, which is trivial to add as a curl command if I have the output from bencher.
The GitLab metrics report would probably solve all my issues
My understanding is that GitLab still doesn't support graphing metrics over time nor does it have configurable thresholds and alerts. Those are two of the main use cases for most Bencher users.
Thank you for the example output! That's super helpful.
The output still doesn't show me a comparison to the main branch (like +15%)
You need to create a Threshold. In order to show you something like +15%, Bencher needs to know what the baseline ought to be, and Thresholds are the way to define that baseline. That's what all of the ⚠️ WARNING: No Threshold found!s are about.
There is still no link to a plot that includes the main branch and my branch data points
As long as you have data on the target branch, ie main and you use the --start-point option (like you are) then the plot links like the ones you provided include historical data from the target branch: 📈 view plot
You probably want to also add the --start-point-reset flag. This basically resets your MR branch onto the latest target branch's results each run. This is useful to prevent drift in Statistical Continuous Benchmarking data.
I still don't know what to supply as a branch to not keep data of merge requests around forever
Once you're done with a branch you can Archive it. With the CLI this is the bencher archive command. There is an example in the GitLab CI/CD Merge Request docs.
if [ "$MR_STATE" = "closed" ]; then
bencher archive \
--project project-abc4567-wxyz123456789 \
--token "$BENCHER_API_TOKEN" \
--branch "$CI_COMMIT_REF_NAME"
else
echo 'Merge request is not `closed`. Skipping archival.'
fi
I just merged in a PR to allow the project keys to be able to archive branches (#845), so you will be able to use --key bencher_run_abc123WXYZ here after the next release.
As soon as I set --branch to something different than main, the threshold is no longer recognized (WARNING: No Threshold found!). However, for this to make sense, it should use the threshold for the branch from --start-point t, right?
If I set --branch main, I have a threshold and relative data output. But of course, this then gets recorded into the main stats.
The --start-point-reset flag is for when multiple benchmarks are run in the same merge request, to not compare the data to the previous run in the MR but to main?
You can also construct Thresholds for the MR Branch explicitly if you want them to be different from the Start Point Thresholds using the --threhsold-* options.
Activity
epompeii commentedon May 12, 2026
Hey @sophie-h thank you for using Bencher, and I'm sorry things aren't clear.
I would recommend checking out how to use Bencher in GitLab CI/CD, since you're using GitLab. That should get you started.
There's also a CI provider agnostic guide for how to track benchmarks in CI with Bencher.
The only difference for Bencher Bare Metal is that you'll need to include the
--imageoption. Otherwise,bencher runshould work just the same as a local run.Adding built-in GitLab MR support is something I've had on my todo for a while. PRs very welcome!
In the meantime, you can just use the
--format htmloption and the--quietflag in order to get an HTML comment to add to the MR.If you're looking to accept MRs from public forks, you will probably need to do a something similar to handling pull request from forks on GitHub.
My understanding is that GitLab still doesn't support graphing metrics over time nor does it have configurable thresholds and alerts. Those are two of the main use cases for most Bencher users.
Does any of that help?
sophie-h commentedon May 14, 2026
I have all the material that you linked, and there is no new information for me.
Here is an example output
Click to view all benchmark results
Click to view all benchmark results
epompeii commentedon May 15, 2026
Thank you for the example output! That's super helpful.
You need to create a Threshold. In order to show you something like
+15%, Bencher needs to know what the baseline ought to be, and Thresholds are the way to define that baseline. That's what all of the⚠️ WARNING: No Threshold found!s are about.I'm looking at the commit here: GNOME/glycin@98aebb4#diff-037ea159eb0a7cb0ac23b851e66bee30fb838ee8d0d99fa331a1ba65283d37f7R69-R70
As long as you have data on the target branch, ie
mainand you use the--start-pointoption (like you are) then the plot links like the ones you provided include historical data from the target branch: 📈 view plotIf you click on the first Metric in the plot you can see that it originates from the
mainbranch:You probably want to also add the
--start-point-resetflag. This basically resets your MR branch onto the latest target branch's results each run. This is useful to prevent drift in Statistical Continuous Benchmarking data.Once you're done with a branch you can Archive it. With the CLI this is the
bencher archivecommand. There is an example in the GitLab CI/CD Merge Request docs.I just merged in a PR to allow the project keys to be able to archive branches (#845), so you will be able to use
--key bencher_run_abc123WXYZhere after the next release.sophie-h commentedon Jun 2, 2026
It doesn't seem to work as described.
As soon as I set
--branchto something different thanmain, the threshold is no longer recognized (WARNING: No Threshold found!). However, for this to make sense, it should use the threshold for the branch from--start-pointt, right?If I set
--branch main, I have a threshold and relative data output. But of course, this then gets recorded into themainstats.The
--start-point-resetflag is for when multiple benchmarks are run in the same merge request, to not compare the data to the previous run in the MR but to main?epompeii commentedon Jun 3, 2026
Ah! In order to clone the Thresholds from your Start Point (ie
main) onto your MR Branch, you need to use the--start-point-clone-thresholdsflag.This is what we're doing in the GitLab CI/CD Merge Request example.
You can also construct Thresholds for the MR Branch explicitly if you want them to be different from the Start Point Thresholds using the
--threhsold-*options.epompeii commentedon Jul 18, 2026
@sophie-h are you okay if I close this out? Or are you still needing help here?