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

Editor became slow when there are more than 300 lines in file #822

Closed
CalixHu opened this issue Sep 5, 2017 · 4 comments
Closed

Editor became slow when there are more than 300 lines in file #822

CalixHu opened this issue Sep 5, 2017 · 4 comments

Comments

@CalixHu
Copy link

CalixHu commented Sep 5, 2017

I have some .exs files(unit test) that contain more than 300 lines(some 1000+). When I hit the 'enter', or do a copy/paste, the editor is frozen for 1-2 seconds. I have turn off all the plugins except the intellj-elixir. However, when I turn off this one, everything works fine. I have increased my memory for the idea VM. Is there a solution for this? I just turned from emacs and this plugin help me a lot.
Thanks.

@KronicDeth
Copy link
Owner

Do you have a lot of stabs in the file? That is ->s? There's a known performance issue with the grammar because it needs to do look-aheads and backtracks to determine if the next line is the starting expression -> or just an expression in the body of the last clause.

@CalixHu
Copy link
Author

CalixHu commented Sep 5, 2017

Yes, I do have lots of that. We have some mock functions in unit test to reduce the duplicates work. Is it possible to fix the issue? Or some workaround?
Thanks.

@KronicDeth
Copy link
Owner

Yeah, it's possible to fix the issue? Sure. Do I understand how to fix it? Not really. See #580.

Work-arounds in your own Elixir code are to have fewer ->, so have more named functions that you take references to with & instead of inlined fn with ->.

If you can post the the file that causes the problems, I can use it as a test case for #580. Go 👍 the description for #580 to vote for it too.

@CalixHu
Copy link
Author

CalixHu commented Sep 5, 2017

OK, thanks for replying so quickly and give us an awesome tool. : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants