Friday, February 29, 2008

10 Tips to Increase IntelliJ IDEA Performance

I upgraded to IntelliJ IDEA 7.0 the day it came out and was, at first, let down by how poorly it performed on my machine. Since then, I tweaked a bunch of settings, and now have it performing just as fast as IDEA 5 ever did on the same box. Enjoy, and happy coding!

1. Change your Look and Feel

Change your look and feel to something other than native. On Windows, the “IDEA (4.5 Default)” look and feel performs much better than the native one. On Mac, just pick something other than the native. The new graphics will bother you for about 30 minutes and then you’ll forget all about them. This setting is in the Settings (Ctrl+Alt+S) -> Appearance (B) dialog. (Tip courtesy of Howard Lewis Ship)

2. Use Structure View Instead of Project View

In IDEA 7.0.2 on Windows, I seem to pay a heavy performance price for the Project View (Alt+1), especially with autoscrolling to and from source enabled. My alternative is to use the Structure View (Alt+2) as my default sidebar and rely on the Navigation Bar (View->Navigation Bar) for project navigation. I find I actually prefer this setup and 7.0.2 performs noticeably faster.

3. Turn off Synchronize Files

When you activate the IDEA frame, IDEA will scan the disk for file changes, giving you a nice progress bar to wait for. If you’re not editing files outside of IDEA then turn this feature off in Settings (Ctrl+Alt+S) -> General (A). Uncheck “Synchronize Files on Frame Activation”. Now you’ll have to manually synchronize the files using Ctrl+Alt+Y (File->Synchronize on the menu). (Tip courtesy of Tyler)

4. Disable Spring Model Validation on Build

I used to get a progress bar every time I ran or debugged my project, with the message “Validating Spring Model”. I don’t need this feature except when I’m working on the Spring files, so I turned it off. Settings (Ctrl+Alt+S) -> Project Settings (1) -> Modules… then click Spring, then click the Options Tab. Deselect the checkbox for “Enable Spring model validation on build”.

5. Disable Unused Plugins

Disable all of the plugins you are not currently using. For example, if you’re not using Geronimo, Commander or Jabber, then turn them off. Settings (Ctrl+Alt+S) -> Plugins (T). Uncheck anything you have installed that is unused (Tip courtesy of Carl)

6. Use Scopes to Speed Up Searches

I rarely really want to search my entire project for a string or reference. Any search dialog allows you to pick a custom scope, such as production files or test files. But “Changed Files” is a helpful option too. On large, monolithic projects you may want to define your own to only search certain packages. A little time creating new scopes will save you a lot of time in waiting for searches to complete. Define scopes in Settings (Ctrl+Alt+S) -> Scopes (5).

7. Increase Your Heap Size

Several sources include directions on increasing your heap size in IDEA. This is changed in your idea.exe.vmoptions file.

8. Always Get the Latest Version

I’ve already suggested this, so I’ll be brief. Each minor release seems to have good performance improvements.

9. Reduce Size of Local History

Another blog recommended that you turn off or reduce Local History. I love this feature so I’ll never turn it off, but the default is to save 3 days worth of work. I typically check in to version control more often than that, so I trimmed it up to 1 day of history. Do this in Settings (Ctrl+Alt+S) -> Local History (J).

10. Optimize Your Disk?

I haven’t tried this myself, but the tip came directly from JetBrains. Beyond just defragmenting, you can also optimize the MFT tables, disk folder structure, and the paging file. Direction appear on their site. Simply upgrading to a newer hard drive is find at home, but I don’t have that much control of my work machine. It’s Friday, so I’ll try this today. If things go horribly wrong I’ll redact the entry!

There are also a few more tips available here. Please leave a comment if you have any other hints!


Tushar Joshi, Nagpur (तुषार जोशी, नागपुर) said...

These are interesting tips. I use IntelliJ IDEA in my course for teaching Java in my Java course. I will try out all your tips one by one.

I have added your blog to my RSS reader. BTW Google Alert for IntelliJ IDEA pointed me towards your blog just now and that is how I discovered your post.

Keep Smiling
Tushar Joshi, Nagpur

yole said...

The tip for "synchronize files on frame activation" is no longer valid for quite a while. The bug which causes "synchronize files on frame activation" to cause performance problems was fixed in version 6.0.2, which was quite a long time ago.

Also, the performance of the local history does not depend on the number of days of history that you choose to store.

Dmitry Jemerov, IntelliJ IDEA development lead

Dion Stewart said...

Nice post, Hamlet.

A couple other things you can do on OS X to increase performance when you're working with large projects...

*disable Spotlight indexing (Spotless can handle this for you if you'd prefer a utility app)
*disable the Dashboard

Dion Stewart

coffeedrinker said...

To increase the heap size on OS X, you change the Info.plist file in /Applications/Intellij/Contents.

On Linux machines, I believe you change the file in the bin directory.

Tim said...

Thank you so much for this post- JetBrains should include it with every email they send informing me of a new release. I've seen enormous performance improvements since following your advice and its really helped renew my enthusiasm for using IntelliJ IDEA.

言承旭Jerry said...
This comment has been removed by a blog administrator.