-
Notifications
You must be signed in to change notification settings - Fork 196
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
Long ElixirLS compile time after upgrading to 0.12 #772
Comments
It seems that the compilation is not using more than one core at a time. This is causing the compilation to take a long time, and making any changes causes it to restart. So it ends up being compiling most of the time, and almost never works if I'm in a development and making a lot of changes. |
I'm in the same situation. What took 1~2 minutes takes now over 15. I don't know if that can help, but those long modules are reading from the filesystem to generate a lot of functions using macros. |
It seems recovered after the tracer disabled, i.e. delete this line :
which introduced in #724 |
That was the most probable culprit. I wonder what exactly makes the compilation single threaded. Most operations there are through concurrent ets. Only project dir is taken synchronously via genserver call but the result is cached in process dict. Maybe the cache hit ratio is low. Unfortunately I don’t have any easy way of testing that. My biggest codebases are not affected by this issue. |
files that triggered "it's taking more than 10s" warning are macro heavy files e.g. absinthe's graphql schema definition, phoenix's router |
thanks @shutangyu I can confirm that absinthe schemas are affected. Now I can profile it.
That's not it, hit ratio is high |
I confirmed that 02d3b2e fixed this issue in my project, thanks @lukaszsamson 👍 |
@lukaszsamson I'm still experiencing this issue with the current version. On a large, macro-intensive project, I get extremely long compilation times every time I switch from one branch to another. The whole time I'm maxing out all CPU cores, and I think it will create an overheating problem if I continue. I'm on an intel macbook running OSX 12.6 |
Environment
Symptoms
We have a fairly large Phoenix project with over 2000 .ex files and a lot of template files.
After upgrading the ElixirLS extension to 0.12.0, the time ElixirLS takes to compile (dyalizer disabled) our project has skyrocketed from about 2 minutes to over 50 minutes. This is observed from the
Output -> ElixirLS
tab in VSCode. Lots of it's taking more than 10s warnings (for almost every file in the project) and very high memory usage (over 1.5GB, observed withtop
).After downgrading the ElixirLS extension to 0.11 it's down to 2 minutes again.
I've seen the same slowdown on my colleagues machines that run MacOS. I've tried to investigate what causes this but with my limited knowledge of this topic I was unable to find a smoking gun. I realize my information in this issue is very limited. Happy to provide more info if requested!
The text was updated successfully, but these errors were encountered: