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

VSCode very slooow when opening minified css file #94

Closed
dfberry opened this issue Nov 18, 2015 · 13 comments
Closed

VSCode very slooow when opening minified css file #94

dfberry opened this issue Nov 18, 2015 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Milestone

Comments

@dfberry
Copy link

dfberry commented Nov 18, 2015

Mac OS X El Capitan, 10.11.1,
VSCode 0.10.1
css file size: 116,198 bytes (119 KB on disk)

The attached file was built with a minifier as part of a grunt task to build the distributable files of a website. Tried to open the file several times to make sure that file is the issue. The app eventually shows a dialog that says "Visual Studio is no longer responding"

When I reopen VSCode after the crash, the folder has been forgotten, it opens to a different folder. When is the "current" folder updated to the existing folder?

I added the .txt extension in order to add it here. The file extension was originally just .css

main.08642f99.css.txt

@bpasero
Copy link
Member

bpasero commented Nov 19, 2015

Sounds like out of memory to me.

@alexdima
Copy link
Member

Cannot reproduce on windows (for VSCode master and 0.10.1). We need to check on OSX El Capitan

@alexdima
Copy link
Member

@dfberry

Just to rule out there's nothing else in your folder interfering (having JS files might cause a lot of memory pressure). Does VSCode crash when you open a new window of VSCode (without any folder - purple status bar) and open just this file?

@alexdima
Copy link
Member

@egamma Can you please try to repro on OSX El Capitan

@egamma
Copy link
Member

egamma commented Nov 25, 2015

I can repro this on OS X. VS Code hangs. Before it hangs I could observe some activity in the tokenizer. Could this be a dupe of a bug you showed us some time ago. Where there was some funny unicode character in the text and then Oniguruma becomes very inefficient on OS X?

@jwulf
Copy link

jwulf commented Nov 25, 2015

Electron Helper CPU usage goes up to 100%. Memory is not the issue. Opened in a new window. Looks like it's biting off more than it can parse.

@alexdima
Copy link
Member

@egamma That must be it!

Long line with at least one multi-byte character that takes forever to tokenize in posix.

@alexdima
Copy link
Member

The problem is in atom/node-oniguruma, more specifically:
https://github.com/atom/node-oniguruma/blob/master/src/onig-searcher.cc#L11
going into
https://github.com/atom/node-oniguruma/blob/master/src/unicode-utils-posix.cc#L38

which makes tokenizing strings with multi-byte characters O(N^2) under posix

@alexdima alexdima added upstream Issue identified as 'upstream' component related (exists outside of VS Code) bug Issue identified by VS Code Team member as probable bug labels Nov 25, 2015
@seixasfelipe
Copy link

I have the same problem having 99% cpu editing an js file. Electron Helper on top of consuming process on my MacOS Yosemite. Anyway to avoid that? Any kind of useful info that I could provide here?

BTW, VSCode never crashes here.

@alexdima
Copy link
Member

@seixasfelipe Will try to raise awareness and possibly contribute a PR to atom/node-oniguruma. The problem occurs on mac or linux when there is a long line with multi-byte UTF8 characters.

@egamma egamma added the freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues label Nov 30, 2015
@egamma egamma changed the title VSCode crashes when opening minified css file VSCode very slooow when opening minified css file Dec 3, 2015
@egamma egamma mentioned this issue Dec 3, 2015
34 tasks
@rjucf
Copy link

rjucf commented Dec 3, 2015

+1

@alexdima
Copy link
Member

alexdima commented Dec 7, 2015

Submitted atom/node-oniguruma#46 that addresses the slow tokenization of long strings with multi-byte characters. Until they accept the PR, I have published a forked module on npm and adopted it in 0f49124 .

Tried out the original CSS file and the file now opens fine on linux.

@alexdima alexdima closed this as completed Dec 7, 2015
@alexdima alexdima added this to the Dec 2015 milestone Dec 7, 2015
@alexdima alexdima assigned isidorn and unassigned alexdima Dec 16, 2015
@alexdima
Copy link
Member

@isidorn This is the long line with multi byte characters case that you also hit some time ago

@isidorn isidorn added the verified Verification succeeded label Dec 17, 2015
@egamma egamma mentioned this issue Jan 6, 2016
59 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

9 participants