-
Notifications
You must be signed in to change notification settings - Fork 85
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
TreeSitter Performance And Stability #263
Merged
thecoolwinter
merged 11 commits into
CodeEditApp:main
from
thecoolwinter:fix/tree-sitter-crashes
Sep 8, 2024
Merged
TreeSitter Performance And Stability #263
thecoolwinter
merged 11 commits into
CodeEditApp:main
from
thecoolwinter:fix/tree-sitter-crashes
Sep 8, 2024
Conversation
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
Atomic property wrapper setters just don't work. Swift grabs the value (with the lock) and then does the operation and then sets the value. There's a small time where the critical section is not protected so we need a class.
thecoolwinter
requested review from
austincondiff,
matthijseikelenboom,
bombardier200 and
tom-ludwig
September 5, 2024 01:29
austincondiff
previously approved these changes
Sep 7, 2024
0xWDG
previously approved these changes
Sep 7, 2024
tom-ludwig
reviewed
Sep 7, 2024
Sources/CodeEditSourceEditor/TreeSitter/TreeSitterExecutor.swift
Outdated
Show resolved
Hide resolved
tom-ludwig
reviewed
Sep 7, 2024
tom-ludwig
previously approved these changes
Sep 7, 2024
thecoolwinter
dismissed stale reviews from tom-ludwig, 0xWDG, and austincondiff
via
September 8, 2024 04:08
0059a0d
bombardier200
approved these changes
Sep 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Stabilizes the highlighting and editing experience for large documents and slow tree-sitter languages. All async operations run using an updated execution manager that is safer, faster, and much easier to use.
Safety Improvements:
HighlightProviding
now has@MainActor
marked callbacks and protocol required functions. In async contexts these will throw a compiler error if not called on the main thread.Performance Improvements:
Highlighter Changes:
HighlightProviding
callbacks now return aResult
object. If the result is a failure and returns a cancelled error, the highlighter now re-invalidates the queried ranges. This means when highlights are cancelled because of some other async operation, they are always eventually fulfilled.TreeSitter Execution:
Task
s to execute, allowing us to use task cancellation, priority, etc.Related Issues
Checklist
Screenshots
Current editing experience. Note incorrect highlights, extremely slow highlighting and maxed thread use.
Screen.Recording.2024-09-04.at.2.54.16.PM.mov
New editing experience for large files, with metrics:
Screen.Recording.2024-09-04.at.2.51.01.PM.mov