-
Notifications
You must be signed in to change notification settings - Fork 42
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
Replace zee-highlight with tree sitter queries #29
Conversation
2fc3d76
to
8a86bbc
Compare
I've been working with this branch a little in my own tree since it is the future and it seems great but I've noticed that with a large number of modes the application start time is poor (~4 seconds on an m1 mac mini with this configuration. This configuration file is a port of the the Helix language configuration file so the argument could be made that users will want something similar as the out of the box experience. The time can be reduced slightly by using a parallel iterator when loading modes creating the editor context but I wonder if the real solution would be to load modes on demand when opening/creating files. I've been looking into making this but haven't been able to satisfy the borrow checker as of yet. |
34ae67f
to
ad27969
Compare
ad27969
to
ed8715e
Compare
@iainh Thanks for trying out this PR! It has motivated me to come back to it and finish the changes.
I have been investigating this. FWIW, this is not the case for me, the editor starts instantly for me on ubuntu -- I don't think it comes down to the cpu, it may be because of a difference between how macos vs linux load shared libraries. The tree sitter parsers are compiled to shared libraries and loaded at runtime using I'm investigating what it would mean to delay the call to |
ed8715e
to
09a39aa
Compare
Ha, actually I'm not sure that's correct -- it looks like the code immediately calls a function from the shared library, forcing loading the library let language = unsafe {
let language_fn: Symbol<unsafe extern "C" fn() -> Language> = library
.get(language_fn_name.as_bytes())
.with_context(|| format!("Failed to load symbol {language_fn_name}"))?;
language_fn()
}; |
@iainh I've just pushed a commit that changes to loading shared libraries for tree sitter lazily -- I'd be grateful if you could check it out locally and let me know if you notice better performance on startup. (I also pushed force previously, so you'll have to reset --hard). Loading libraries lazily is a good idea all around I think, but as mentioned, on Ubuntu 20.04, this make no noticeable difference on startup time. The only downside is that I'd like to have a command line arg to force loading all libraries for CI. |
Whitespace cropping on saving can still break the application. The Colour Panic described #42 is still a symptom therefore. |
@mcobzarenco I can confirm that with this change there is no longer a noticeable delay when starting with the configuration file previously linked. Where as previously the application would appear to hang on startup it now comes up instantly. One interesting test case on my machine is the swift mode. It takes about 1.6 seconds to load and with the old code would block the UI but with the latest change zee comes up instantly, displays the splash screen and then displays the file once the mode finishes loading. I think this is a better user experience than previously but perhaps could be even better with some sort of "loading" message. |
@iainh That's great to hear 🎉
👍 some sort of loading screen would be nice |
5f51577
to
6cd6d00
Compare
No description provided.