yi-editor / yi

The Haskell-Scriptable Editor
GNU General Public License v2.0
1.51k stars 203 forks source link

Javascript mode crash opening 6380 loc javascript file #1011

Open codygman opened 7 years ago

codygman commented 7 years ago

Using Yi (33306eab672c9f8fff268a92852e295459ea67c8) and javascript-mode on a very large javascript file from react:

https://github.com/facebook/react/blob/e35724a03d66bb73dbbec4dc4b12a5170bfe2615/src/__mocks__/vendor/third_party/WebComponents.js

I opened the file in vty mode with vim keybindings and then tried to go to the end of the file with G in vim mode. It consumed all of my memory and I had to reboot my system.

codygman commented 7 years ago

Added specific commit of Yi I was using.

codygman commented 7 years ago

Could very well be related to #105.

noughtmare commented 7 years ago

From the author of the mode https://github.com/yi-editor/yi/issues/143#issuecomment-10506777. It seems yi-mode-javascript is abandoned. I think the best option to solve this is to make a fastMode equivalent that just uses the lexer to do the highlighting.

codygman commented 7 years ago

@noughtmare Alright, thanks for the direction. I was using the Javascript mode to see how Yi fared for incremental parsing on large files. #105 leads me to believe that until that issue the leak issue is fixed there will be performance issues.

noughtmare commented 7 years ago

@codygman A fastMode would only use the lexer and therefore bypass the whole incremental parser.

But the performance problems in the javascript mode are much more severe than for example in the haskell mode. So I think improvement is still possible.