-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Shard benchmarks across multiple CI jobs #92
Comments
Hey @overlookmotel, thanks for the kind words! To reduce the build time for everyone, we will definitely look at what @Boshen did in oxc-project/oxc#2343. This seems like something that could easily be implemented directly in this repo, so that everyone gets lower build time. As far as sharding the benchmarks across multiple CI jobs, this is something that we will have to look into. At the moment CodSpeed only supports a single upload per run, so we would need to add some kind of sharded uploads per run or find a way to generate reports in multiple CI workers, then in a final job aggregate the reports and make a single upload. The former solution would require a lot of rework on our app and take a lot of time. The later might be more hackable, since the changes would only need to be done on our open-source https://github.com/CodSpeedHQ/runner and https://github.com/CodSpeedHQ/action repositories |
We've implemented sharding via a rather hacky method on oxc-project/oxc#2751. Now that can see it works, I'd like to "do it properly" and submit PRs against https://github.com/CodSpeedHQ/runner and https://github.com/CodSpeedHQ/action so everyone can benefit. A few questions:
|
Hey @overlookmotel, sorry for the delay in my response. We talked about it internally and we want to directly support multiple uploads in our backend. Thanks a lot for the work you already did on this 🙏 and I am sorry that we do not continue down the single upload way. I will update you when we have them, and if you are still willing, it will be a pleasure to have you contribute to the runner/action! |
OK cool. That does sound like an ideal solution. If I can add a couple of suggestions: 1. Results on completionSome benchmarks (shards) will may take much less time to run than others (that's certainly the case with Oxc). It'd be ideal if results from completed shards were visible on CodSpeed as soon as they're uploaded, and the rest show as "Running..." - as opposed to have to wait for all the shards to finish running before you can see the results for any of them. 2. Handle missing benchmarksOxc has multiple crates. Currently the benchmarks for crate X run even if the only changes in the PR are to crate Y (and X doesn't depend on Y). This is wasteful of CI resources, and I'd like to run only the benchmarks for the crates which could be affected by the code changes in the PR. However, if you just prevent some benchmarks from running, then they show on Codspeed as "Missing" and it makes everything look red and bad! To work around this, I have hacked together something to cache benchmarks results from a previous run and re-upload them (without actually running the benchmark again): This isn't the right way to do it of course, but it'd be nice if CodSpeed could somehow handle this scenario where not all benchmarks run, but that is intentional rather than a problem. |
Definitely, we plan to do incremented report updates. This is one of the upsides of allowing multiple uploads for a single run.
We have thought about it in the past, but we could not find a way to implement this at that moment. |
Yes, that's true - the ambiguity is a problem. Maybe if the action allowed you to input that information. e.g. I guess you will have this problem in some form regardless of my request. How can CodSpeed backend know when the run is done and it's time to generate the report comment? e.g.:
I suspect one of these will be required:
Either way, that'd be a good place to add a message "benchX is skipped, not dropped". |
Hey just wanted to check if there's any updates to supporting sharded benchmarks? We just integrated CodSpeed into Daft: Eventual-Inc/Daft#2696 and I think it'll be really useful! |
Thanks for the interest @colin-ho, glad to have Daft using CodSpeed! Sharding is still on our roadmap, we will update this issue when it is relevant. |
OXC Javascript compiler is using CodSpeed for measuring performance. For a performance-focused project like OXC, CodSpeed is absolutely amazing.
However, running the benchmarks is currently by far the project's slowest CI job.
Would it be feasible to enable sharding the benchmarks across multiple CI jobs, to shorten both the build and execution time of each, and then a final job to pull the results together and upload to CodSpeed?
The text was updated successfully, but these errors were encountered: