Making IntelliJ IDEA Run Faster and Better

I took the time to listen to the, about one hour long, IntelliJ IDEA Architecture and Performance video, by Dmitry Jemerov from Jetbrains. Most of the beginning of the video was not very intesting for me, but 37 minutes into the video, the good stuff comes :-) Here is a little extract, of some main points of Dmitry, on how to make IDEA run faster:

Optimizing IO

A tool like IDEA is naturally heavily IO-bound, in that it needs to keep track of very large amounts of files. Not surprisingly, you can achieve better performance, if you can make IDEA do less IO or optimize the IO, that it does perform:

  • Apparently, they (Jetbrains) has done experiments and measurements, that shows 10,000 RPM drives to show better performance in IDEA. If they say so, I have no reason to doubt it. I would not have chosen that, as my first experiment myself.
  • Avoid storing source, IDEA caches or any other files related to IDEA, on network drives. That one is quite obvious, I think.

Then, there are some more specific issues on IO, which are more or less related directly to Windows users. These tips can remove signifant overhead on each file access:

  • Disable antivirus scanning on (IDEA) system directory. I have heard this one before, as a more general advice, to optimize performance on Java desktop applications on Windows. Most (if not all?) antivirus software, scan jar files too. Dmitry mentioned, that a file close operation, which should take near to no time, can take up to half a second, with some antivirus software. Auch!
  • Regularly run disk defrag. Oh, how I just hate NTFS “performance”. Currently, my laptop drive is near full, and system performance degrades like hell. And defrag is hardly possible, when nearly no space is left :-(
  • Turn off Windows System Restore. I did this, and as a side-effect, I also got 4,5GB of diskspace back. Space, that windows system restore had taken. “Nice”. Of course, there is an clear down-side of this, as you are not able to restore windows from a previous sync point. But then again, I have never had that need. It isn’t that I haven’t had windows fuck up my disk, I just have never had any chance to use this restore shit when it happened.

JVM Based Optimizations

  • Use JDK6: There are plenty of performance improvements from Sun, that helps IDEA.
  • Setting -Xmx (max heap), but “reasonably sized projects”, like the source to IDEA itself, does not need more than 300-500 megs. So do not set it too large.
  • One exception though: If you feel like running IDEA with -server, then -Xmx1G or more should let IDEA’s caches live longer (due to soft-references living longer with large mem available in -server mode). My note: Be sure you have the physical RAM available!
  • If you are on a multi-core machine, enabling parallel garbage collection can help (reduces gc pauses). Note: Some have stability issues with this.

IDE Related Stuff

Here are some stuff, which have to do with settings or the like on the IDE itself, which can help it perform better:

  • Use latest version. Well, dugh! Of course they are gonna say that. I am sure there is some truth in it, but new features also take out some performance. Take an old IDEA 4 and run it on todays hardware, and I bet you will see great performance. But who would wanna do that.
  • Disable unused plugins (like the commander? :-) It must be mostly load-time that will benefit here?
  • Exclude unneeded folders. Actually, this one could have been listed under the IO-related bullets too, as it is to reduce IO/file surveillance. An example is to exclude build-generated stuff. My note: More often than not, your source depends on the generated stuff, so no good idea excluding it.
  • Set version control to “None” for generated code.
  • Do not disable “Synchronize files on frame activation” (since 6.0.2). Supposedly, they have done something great, for this file synch to not be a (big) problem anymore.
  • Use “Project” mode in the “Project view”, as the “Package” mode is slower. A bit of a surprise to me, but they actually know, that they have a performance problem when using “Package” mode. No problem for me, as I am nearly always using the “Project” mode anyway.
  • Disable expensive inspections: Some of the inspections IDEA performs are supposedly heavy. Sadly, there is no advice on which to disable, so…
  • Disable framework-specific validation (JPA, spring, …) on Make: I have done this myself sometimes, but mostly due to validation errors that were actually wrong, and was wrongly failing my build. But it does perform faster builds without. Also, not that big a problem, as I mostly build from outside IDEA, using maven.
  • Do not use method breakpoints: Apparently, you can experience slow debugging if you use method breakpoints. This is said to be a JDK issue.

This was the complete list of advice on upping the performance of IntelliJ IDEA as Dmitry said it.

Q and A

Then came the Q and A part of the presentation. Here are some of the interesting ones related to performance:

  • Q: Synchronizing a lot of changes from disk pegs one cpu/core. How come?
  • A: This operation is not parallelized (…yet, it will be in v8 with the new indexing framework)
  • Q: Restart required on plugin install. How come?
  • A: Blah blah, plugin might not work otherwise. Blah blah. We might make this better in v8. Blah.

A Bit About Version 8

Apart from the performance stuff, there were some bits of information on the upcoming version 8 in the video. Many of the things they are building seem to emphasize language indendency, as in, they are general operations or frameworks, that can support all languages. This includes the new indexing framework. I guess this is due to plans on supporting much more languages in their IDE, and I think I heard Python mentioned (but okay, the talk was at google, so… :-)

That were the highlights as I heard them, but go see/hear the video yourself, if you want the details.

May 20, 2008 В· polesen В· 3 Comments
Tags: ,  В· Posted in: Tools

3 Responses

  1. Benjamin - May 21, 2008

    One personal expierience: I had *real* performance problem with my Laptop esp. using IDEA though defragmenting disk and regulary maintaining my windows in-depth. I already started to believe it’s a hardware problem. But then I stumbled over this Blog entry (http://blogs.jetbrains.com/idea/2006/12/boosting-intellij-idea-performance-on-windows-systems/) which solved my problems.

    Windows keeps tracks of its files inside the MFT! This MFT can (though it *never* should) defragment if a) the disk gets nearly full and b) you have many files (which is natural for Java-Developers). You can *check* this using the windows defragment tool, but *NOT FIX* it with it. Finally I had a MFT defragmented in 640 pieces and a real,real bad performance.

    The proposed solutions worked perfectly for me (defragment MFT offline during windows startup using commercially available products)!

  2. Nicolas Martignole - May 19, 2009

    I have a big project based on a set of multiple maven modules. Each module is a Maven2 project, with a generated IDEA Intellij Module.
    In Project settings view, in the project structure, check that your Web Facet module does not have “Create web facet war file” activated in the Java EE Build Settings unless you plan to use IDEA Intellij to build your war or your archive.
    It will boost the performance at each “Make” operation.

  3. Vivek - November 27, 2012

    It is also required to change a few values if the User Directory ${user.home} by default is mapped to a Network Drive. This will improve the performance and will also fix the wierd erros that IntelliJ may give otherwise.

    I was getting wierd errors with IntelliJ internal classes and the IntelliJ build was failing to compile any modules

    IntelliJ Internal error: (java.io.FileNotFoundException) \rbmgfs1015\home$\kumarv02\.IdeaIC12\system\compile-server\endeavour_7c3a61b8\timestamps\data (The system cannot find the path specified)
    java.io.FileNotFoundException: \rbmgfs1015\home$\kumarv02\.IdeaIC12\system\compile-server\endeavour_7c3a61b8\timestamps\data (The system cannot find the path specified)
    createComponent returns null for class com.intellij.codeInsight.daemon.DaemonCodeAnalyzer

    To fix the above errors, I made changes to idea.properties file to force it point to the local drive

    idea.config.path=D:/JetBrains/IntelliJIDEA/config
    idea.system.path=D:/JetBrains/IntelliJIDEA/system
    idea.plugins.path=D:/JetBrains/IntelliJIDEA/config/plugins
    idea.log.path=D:/JetBrains/IntelliJIDEA/system/log

    This fixed the problem with IntelliJ compilation.