-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Accidentally quadratic #2837
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
Accidentally quadratic #2837
Conversation
411b575 to
99662f8
Compare
|
@flodiebold curious what you think about this! The problem here is that, when we go from Now, the obvious solution here is to add caching, however, it turns out not to be too straight-forward to implement. At least, not straight forward with salsa.
So, instead we introduce a
|
|
Hmm, I have to think about this a bit, but this:
is something that I noticed a lot when working on the assists. It made the API feel wrong, because it doesn't help you at all to use the correct |
crates/ra_hir/src/source_analyzer.rs
Outdated
|
|
||
| /// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of | ||
| /// original source files. It should not be used inside the HIR itself. | ||
| /// original source files. It should not be used pinside the HIR itself. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
As an aside... are there operations we should be continuously benchmarking? |
|
@kjeremy I don't think continuous benchmarking would be too valuable at the moment, as we haven't settled down on the overall architecture I think. That is, I expect that various random refactorings would affect benchmarks more than targeted optimization work. We should have tests that something isn't exponentially slow though, like the one added in this PR, whose failure criteria is basically "the test suite never completes". |
|
Also, it probably makes sense to fix things like #2821 (comment) or rust-lang/chalk#298 before starting the benchmarks. |
e7918f1 to
b99d366
Compare
|
|
||
| #[test] | ||
| fn test_highlighting() { | ||
| fn te3st_highlighting() { |
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?
b99d366 to
aaef88d
Compare
flodiebold
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.
Makes sense to me!
|
bors r+ |
2837: Accidentally quadratic r=matklad a=matklad Our syntax highlighting is accdentally quadratic. Current state of the PR fixes it in a pretty crude way, looks like for the proper fix we need to redo how source-analyzer works. **NB:** don't be scared by diff stats, that's mostly a test-data file Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Build succeeded
|
Our syntax highlighting is accdentally quadratic. Current state of the PR fixes it in a pretty crude way, looks like for the proper fix we need to redo how source-analyzer works.
NB: don't be scared by diff stats, that's mostly a test-data file