Sherlock
Sherlock

Reputation: 7597

PHPStorm exceptionally slow while editing Javascript

I'm using PHPStorm (5.0) as PHP IDE, but I'm busy building some frontend stuff with Javascript at the moment. The problem is: PHPStorm gets very slow. It uses all 494M of memory while editing the Javascript file. I don't have any active files other than my Javascript file. The file itself is only 191 lines long.

Is there anything I can do to speed things up?

Upvotes: 30

Views: 25363

Answers (8)

Turdaliev Nursultan
Turdaliev Nursultan

Reputation: 2576

As of 2018 it's completely different. PHPStorm provides a simple way of changing JVM options.

  1. From the main menu, choose Help | Edit Custom VM Options
  2. Change Xmx value to a higher value. Default value is 750m. Increasing it to 1024m was enough for me.
  3. Now your PHPStorm should start working as usual.

Upvotes: 0

dpde
dpde

Reputation: 11

I had the same issue a while ago, here is what helped me to resolve it.

First make sure you exclude the node_modules folder in Settings -> Directories.

This change made it better for me, but did not resolve all the performance issues I had with JavaScript files.

  1. Uninstall PHPStorm
  2. Download and Install the JetBrains Toolbox (https://www.jetbrains.com/toolbox/app/?fromMenu)
  3. Install PHPStorm via the JetBrains ToolBox
  4. Open the PHPStorm settings menu within the Toolbox (Screenshot)
  5. Increase the maximum heap size to 1024 MB
  6. Restart PHPStorm

Upvotes: 1

DoctorP
DoctorP

Reputation: 169

PHPStorm and all Jetbrains products are slow wjen opening large files (2000+ lines of code). You may have a good PC but the problem is not in PC or processor. On the same hardware Eclipse, Netbeans are much better if we are talking about speed. Just read this: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206999515-PhpStorm-extremely-slow-on-large-source-files

Upvotes: 0

decoy85
decoy85

Reputation: 73

Fix 1. disable spelling. File->Settings->Editor->Inspections->Spelling

Fix 2. If on linux try this: In /phpstorm/bin/ you find - phpstorm.vmoptions - phpstorm64.vmoptions

In phpstorm goto help->about and check if JRE is 64 or not. If 64 edit phpstorm64.vmoptions.

Insert these 2 lines at the end. -Dawt.java2d.opengl=true -Dsun.java2d.xrender=false

Upvotes: 7

Henry
Henry

Reputation: 7881

I just went through a fairly detailed process with JetBrains. It turned out it was my secondary monitor. I have a 28" retina display. If I run it on the default resolution 1920x1080 in true retina it runs fine. When I up the resolution the performance really starts to drag. As of right now (June 2016), this is an open issue in their system with no solution.

I also discovered that if you use .gitignore, you should also mark these files and directories as 'Excluded' in the IDE. That helps somewhat with larger projects.

Upvotes: 1

Damian Kleiman
Damian Kleiman

Reputation: 39

PHPStorm will always feel slower than native apps on whatever OS you have (I use it on Windows, Linux and Mac), just because Java is slower. I had to do a lot of tweaking to make it feel faster, and the only thing that really improved speed was a SSD hard disk.

Try tweaking vmoptions file a bit and you will get better performance, but dont expect it to behave like native apps. For simple file edits (not projects) just use an editor like Sublime Text, Vim or whatever.

Upvotes: -2

1nfiniti
1nfiniti

Reputation: 2070

If you're running a project with an exceptionally large code base, the performance of the IDE can really chug because by default it watches all the files in all subdirectories of your loaded project.

Generally, a large code base will not require watchers on a good portion of the files. You can improve performance by going to File/Settings/Project/Directories and excluding any folders you do not need to watch/search within.

If you do need to search within those files, you get the option to include excluded directories and search again anyway.

Also, disabling any plugins you aren't using can help improve performance as well, but not as much as the directories thing.

Upvotes: 39

CrazyCoder
CrazyCoder

Reputation: 401897

In case of the performance isues file the problem at YouTrack and upload a CPU snapshot, each problem is unique and requires investigation.

Upvotes: 2

Related Questions