-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(config): add [workspace-]diagnostics
fields to statusline
#13288
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
Merged
the-mikedavis
merged 3 commits into
helix-editor:master
from
RoloEdits:statusline-diag-config
Apr 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It could be smaller (both the source and the machine-code)
I'm unsure if the code is worth rewriting as it's not really perf-critical.
However, the implicit
i32
instead of something likeu16
feels like it could be improved.I had the idea that if all of the counts are "exhausted" (either by overflow, or when reaching an arbitrary limit), then the loop can
break
early and the counts could be displayed as "999+" (just an example)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.
Changing the datatype to something that cannot be negative could be a type improvement, though we already start them at 0 and only count up, but adding a branch just for checking if its 999 and then again for if there should be a
+
would probably remove any gained performance for anything else we do.Most of the time its only looped <100 times, which is very quick no matter the instructions, and ive not seen this be a hotspot. The main one with the statusline (so far) was patched in #12385 (it even shows the statusline highlighted) for the relative path.
As far as the easiest win, even just reordering the most often case to the top and least common at the bottom would address most branches we get here. Its almost never
None
, yet there is a branch for that at the top. Given the defaults, havingWarning
,Error
,Hint
,Info
, and thenNone
, top to bottom, would probably be best order?Thankfully, helix runs very well, and from what I have seen in profiling, although has some hotspots, they might just need to take that long for the work being done.
Addressing this match loop would be one of the very last things I would look at for perf gains.
If you want to start to target some performance bottlenecks, I think opening an issue could bring in collaboration (and spotlight to issues). For instance, I have been meaning to look at the path normalization function, as that takes a lot of time, and look into a full lexical resolution (
..
in paths), with a syscall as a fallback. I just dont know enough about this domain to really say if it can be avoided or not.There has also been talk to get a benchmark suite setup for some critical areas first. This way we can test things like having static collections be a
Vec
, or if aHashMap
would actually be faster at the size.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.
Fair enough
I think it would be better to wait for
likely
to stabilizeFair enough x2
I agree, lol. Even if it was perf-critical, it would still be efficient-enough in practice
I might check that code later. Thanks for the pointers!