vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Slow/laggy when opening large (~200K) files

Open brockallen opened this issue 10 years ago • 10 comments

  • VSCode Version: 0.10.11
  • OS Version: Win 10

Steps to Reproduce:

  1. Open folder containing this file: https://github.com/kjur/jsrsasign/blob/master/npm/lib/jsrsasign.js
  2. Open file and scroll around a bit. VS Code gets really slow/laggy.

brockallen avatar Mar 31 '16 14:03 brockallen

@brockallen Thanks a lot for filing this! :+1:

.. Looks like most time is spent in decodeTextMateToken:

image

alexdima avatar Mar 31 '16 15:03 alexdima

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

alexdima avatar Apr 08 '16 09:04 alexdima

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...

digeff avatar Apr 25 '16 20:04 digeff

  • 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:

  1. Open a large JS file (e.g., http://developer-autodesk.github.io/viewer3d/2.2/viewer3D.js)
  2. Wait a few seconds to see editor crash.

sergeykhrykov avatar May 14 '16 23:05 sergeykhrykov

@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:

lnaojqzf2f

The fix will come with the May release and please open a separate issue if you still see the crash in this case.

alexdima avatar May 26 '16 11:05 alexdima

@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.

alexdima avatar May 26 '16 11:05 alexdima

@aeschli Where do we get the JavaScript grammar from? https://github.com/Microsoft/TypeScript-Sublime-Plugin ?

alexdima avatar May 26 '16 11:05 alexdima

It's the TypeScriptReact grammar from https://github.com/Microsoft/TypeScript-TmLanguage

aeschli avatar May 26 '16 13:05 aeschli

The slowness on our side is dealt with for this example, let's use this to track Microsoft/TypeScript-TmLanguage#174

alexdima avatar May 26 '16 14:05 alexdima

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

alexdima avatar Jul 05 '16 07:07 alexdima