Skip to content
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

edlin expansion takes ~15s for erl_syntax #9215

Open
robertoaloi opened this issue Dec 18, 2024 · 3 comments
Open

edlin expansion takes ~15s for erl_syntax #9215

robertoaloi opened this issue Dec 18, 2024 · 3 comments
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@robertoaloi
Copy link
Contributor

Describe the bug
In the context of #WhatsApp/erlang-language-platform/issues/70, I started playing around with edlin auto-completion and noticed it can be very slow for certain functions.

To Reproduce

1> timer:tc(fun() -> edlin_expand:expand(lists:reverse("erl_syntax:concrete("),[]) end).

This takes almost 15s for me the first time. Then, the result is cached.

Expected behavior
Completions are provided much faster.

Affected versions
OTP 27

@robertoaloi robertoaloi added the bug Issue is reported as a bug label Dec 18, 2024
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Dec 19, 2024
@garazdawi
Copy link
Contributor

There is a reason why there is a cache :) We could add a way to heat up the cache in advance, but it could be rather memory hungry on large system.

@josevalim
Copy link
Contributor

@garazdawi do you know what is expensive in this case? Trying to resolve the types?

@garazdawi
Copy link
Contributor

I haven't looked into this specific case, but in general when we do completions we follow all the types until their end, so the first completion request can en up touching a lot of files that are parsed for their type information.

@frazze-jobb probably has a better idea around what is slow.

@frazze-jobb frazze-jobb self-assigned this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

5 participants