-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add rustdoc-json perf check #1512
Add rustdoc-json perf check #1512
Conversation
Running manually is always an option, and running it automatically only on rustdoc PRs seem reasonable. With the upcoming runtime benchmarks, we will maybe also need some semi-automatic way of filtering what benchmarks should be executed, based on the PR type.
It sounds reasonable to me, assuming that:
I'm also a bit worried about extending the Profile/Scenario enums. I already dealt with this when we were adding the "binary size" benchmarks, which basically do an |
We will run some perf checks on our side and publish them here so we can have a good idea overall if it's even that useful in the first place. 👍 |
I think this is hard -- you need the runs against master to compare to, and while we could make that incremental too (i.e., only collect partial results and then back-collect as needed), it seems hard to make that work well for things like noise level evaluation, etc. So I think we should prefer running always, and see if the impact to overall time taken for collection is significant. Ultimately the current cost of the collection infrastructure is relatively low; if we invest in parallelism support in perf we could scale horizontally there relatively easily. |
Just ran into another case where this would be super usefull to have (rust-lang/rust#108626). In responce to your questions:
While we don't have any way to get absolute numbers, the
Looking further into this, I'm not sure this is true.
( This seems to suggest that performance (for JSON) is entirely dominated by how quickly rustc can be done, whereas rustdoc HTML can become dominant. |
On the other hand, theirs alot of selection bias in play here, as I chose |
To be honest, if On the other hand, this PR is small and it could be quite useful for local testing, so I'm not opposed to it. I wouldn't include json-doc to the perf. RLO CI suite though, as we would have to think of some way how to distinguish it from the rest of the profiles. Just adding another |
Further investigation has shown that Trying instead with
(awslabs/aws-sdk-rust@66423e0, all fresh builds) Which seems to suggest that Rustdoc JSON is the performance bottleneck for some users and displays completely different performance charecteristics to HTML |
Thanks for the investigation! Then it sounds like indeed JSON output is something that could be investigated for better performance theoretically. I would still not add it to the CI suite as it is though, we'd need to think of some way of changing the current categories. But for local profiling it's fine by me. |
This is not what's slow in stm32. stm32 is dominated by this horrible O(n^4) section of code: https://github.com/rust-lang/rust/blob/c183110cc26abb506dba0a4def917735fb6eb6f0/src/librustdoc/clean/blanket_impl.rs#L22-L85 Maybe the JSON backend doesn't collect blanket impls and that's why it's closer on stm32. |
@@ -291,7 +291,7 @@ impl Benchmark { | |||
} | |||
|
|||
// Rustdoc does not support incremental compilation | |||
if profile != Profile::Doc { | |||
if profile.is_doc() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo?
if profile.is_doc() { | |
if !profile.is_doc() { |
The JSON output format is taking more and more importance in rustdoc and we reached a point where performance checks would start to make sense.
Now, with that said, this remains a very specific feature and I'm not sure if it's worth having it tested by
rustc-perf
directly. It will also add noise considering that rustdoc benchmarks tend to be noisy ones. Maybe the solution here would be to only run this check manually or on rustdoc PRs? But before even that, do you think it's a good idea at all?