-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Performance oriented fixes. #841
Conversation
I've been working on this branch for a couple of weeks and haven't noticed any regressions or issues. The improvements are drastic, especially on my project.
Notes:
|
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.
Code checks out, and I'm continuing to use this branch without issue.
Would it make sense to change Lexical.Debug.log_timed/3
to debug
level instead of info
? That's the only outstanding consideration I have.
Note: this requires more work. * The locations of a project's .formatter.exs files should be cached, along with their mtimes so we can calculate their AST once. * Additionally, we need to check to see if the .formatter.exs is opened, and if it is, use that AST.
We were calculating the context of the cursor once per suggestion, this would take a couple dozen milliseconds, but for a module that had a lot of functions, this would add up. Precalculating them saved a lot of time.
Jose added a function that allows us to get a formatter without having to lock on the build. This reduces the formatting time significantly, and we no longer have that frustrating freeze on save.
This commit fixes a number of performance related issues, and reworks formatting so it's lock-free and able to be used with format-on-save in any editor. The fixes are: