-
Notifications
You must be signed in to change notification settings - Fork 1.9k
analysis-stats: allow parallel type inference #5142
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
Conversation
|
That's pretty cool! Is there any reason except comparison purposes to make this optional? |
|
I don't think the lsp server uses parallel type inference. |
Single-threaded inference is deterministic (I think?), while multi-threaded inference isn't. This can be a helpful property when trying to narrow down bugs, and also makes benchmarks more reproducible.
Yeah, this is just an experiment for analysis-stats. Interactive use is unlikely to benefit from this as types are only inferred for function bodies visible in the editor. |
Nope: #1552 |
|
Ah, that's unfortunate. But adding threads on top makes it even more noisy. |
|
Well, it's supposed to be deterministic, yeah. And analysis-stats is a good tool for finding non-determinism (which I should do sometime again...), you're right. |
matklad
left a comment
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.
bors r+
| serde = { version = "1.0.106", features = ["derive"] } | ||
| serde_json = "1.0.48" | ||
| threadpool = "1.7.1" | ||
| rayon = "1.3.1" |
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.
Just seeing rayon in Cargo.toml creates an impression of speed 👍 !
This is mostly just for testing/fun, but it looks like type inference can be sped up massively with little to no effort (since it runs after the serial phases are already done).
Without
--parallel:With
--parallel: