Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webstorm becomes extremely slow with node.js

Anyone knows what's the deal with this IDE? I have been running it for a while, lately it has become very slow and unresponsive at times. Gobbles up CPU even when just editing a bunch of js files.

Possibilities: 1. My code base is getting bigger... 2. I have several listeners which compile coffeescript and sass files in the background when these change.

In any case, I am very surprised (for the worse) that this is so slow. Would expect better from a developer of an IDE.

Anyone had this kind of problem before? 10x

like image 292
Ilan lewin Avatar asked Sep 10 '14 12:09

Ilan lewin


People also ask

Is WebStorm slow?

WebStorm is very slow when working with typescript – IDEs Support (IntelliJ Platform) | JetBrains. Please consider editing your post and mark it as obsolete instead.

Does WebStorm support Nodejs?

WebStorm integrates with Node. js providing assistance in configuring, editing, running, debugging, testing, profiling, and maintaining your applications. If you need Node.

Why is node so slow?

Node. js programs can be slow due to a CPU/IO-bound operation, such as a database query or slow API call. For most Node. js applications, data fetching is done via an API request and a response is returned.


2 Answers

There are a couple performance tweaks you can apply to Webstorm to see if it improves your situation. When my colleagues and I found that Webstorm was slowing down these tweaks solved all our problems.

First things first, ensure your project is configured to utilise webstorm resources efficiently by excluding particular directories from a project. This will ensure the containing files are not indexed in memory and will not decrease performance when performing functions such as searching for files or text within files. Some examples of good candidates to exclude are the node_modules directory and compiled code directories.

If there are still performance issues, try the following:

If you are on Windows by default you would be using the 32-bit version. Navigate to the Webstorm directory (within program files) and you'll see webstorm64.exe, which will run Webstorm in 64-bit mode. (You might need to install a proper 64-bits JDK yourself then.)

The default VM options for IntelliJ IDEA may be not optimal when your project contains more than 10000 classes and developers often try to change the default options to minimize IntelliJ IDEA hangtime.

You can try bumping up the JVM memory limits for Webstorm. Open the VM options from the IDE_HOME\bin\<product>[bits][.exe].vmoptions. Initially try doubling the Xms and Xmxmemory values.

Please note that very big Xmx and Xms values are not so good. In this case, GarbageCollector has to work with a big part of memory at a time and causes considerable hang-ups.

For more info on configuring JVM memory options you can refer to:

  • Configuring IntelliJ IDEA VM options - http://blog.jetbrains.com/idea/2006/04/configuring-intellij-idea-vm-options/
  • Configuring JVM options and platform properties - https://intellij-support.jetbrains.com/entries/23395793-Configuring-JVM-options-and-platform-properties
like image 162
Andrew Avatar answered Oct 09 '22 15:10

Andrew


You can now do it from UI.

enter image description here

These are my before-after. No problems with the garbage collector. Just multiplied all values by 4. Machine: 20Gb RAM, 4Ghz i7 CPU & SSD disk. With defaults it started to lag. Now no lag again.

Pasting as text for quick copy:

# custom WebStorm VM options # Default: # -Xms128m # -Xmx750m # -XX:ReservedCodeCacheSize=240m # -XX:+UseCompressedOops  -Xms512m -Xmx3000m -XX:ReservedCodeCacheSize=960m -XX:+UseCompressedOops 
like image 41
Lukas Liesis Avatar answered Oct 09 '22 16:10

Lukas Liesis