Slow/laggy when opening large (~200K) files
- VSCode Version: 0.10.11
- OS Version: Win 10
Steps to Reproduce:
- Open folder containing this file: https://github.com/kjur/jsrsasign/blob/master/npm/lib/jsrsasign.js
- Open file and scroll around a bit. VS Code gets really slow/laggy.
@brockallen Thanks a lot for filing this! :+1:
.. Looks like most time is spent in decodeTextMateToken:

This is now fixed on our side by optimizing the decodeTextMateToken function, but we still need to investigate what makes the grammar go crazy and generate 20+ embedded scopes in this case
Create a file full of (as in half a millon lines): 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
VS Code starts to work slowly (Version 1.0.0 in Windows). Also if you try to do Ctrl + A to select all the code it crashes. There are many ways to break VS Code or make it crash when using very large files...
- VSCode Version: 1.1.0
- OS Version: Win 10 x64
Trying to open a large JS file (~85K SLOC) makes window crash.
Steps to reproduce:
- Open a large JS file (e.g., http://developer-autodesk.github.io/viewer3d/2.2/viewer3D.js)
- Wait a few seconds to see editor crash.
@digeff I have just pushed a fix in ca2ca08c63c88f7c0bc2735a37a97ff3b8f600fc that fixes that the <textarea> sync we had for accessibility purposes (screen readers) was unbounded and we still have some issues with memory consumption when opening a file (the file gets allocated minimum 2 times), but it gets GC'd after a while (so for your testcase I see the renderer process at 200MB) and with the fix I can select all and have no issue:

The fix will come with the May release and please open a separate issue if you still see the crash in this case.
@sergeykhrykov Thank you for the repro, I can reproduce the crash immediately. I have opened #6916 to better track it. On a first look, it seems it goes OOM.
@aeschli Where do we get the JavaScript grammar from? https://github.com/Microsoft/TypeScript-Sublime-Plugin ?
It's the TypeScriptReact grammar from https://github.com/Microsoft/TypeScript-TmLanguage
The slowness on our side is dealt with for this example, let's use this to track Microsoft/TypeScript-TmLanguage#174
Since all issues on our side are fixed (no more crashes for these test cases), I would prefer to close this issue. The JavaScript grammar is still broken, but that is being tracked in Microsoft/TypeScript-TmLanguage#174