Mixed feelings about IntelliJ IDEA 12

I recently started using IntelliJ ultimate, and for the most part, I find the experience superior to using Eclipse.  It has taken me some time to figure out the equivalents of a few things, but overall the learning curve was fairly minimal.

IntelliJ's code completion in particular is phenomenal compared to Eclipse's and I love the general layout and theming options (Darcula in particular).

However, there is one thing in particular that greatly annoys me about Intellij IDEA: the performance of "hot swap" is not so great compared to Eclipse; in Eclipse almost the same moment I save the file changes show up in my Java application, in IntelliJ, I have to "save", "make project", and then wait a few seconds before the changes show up.  Since I mostly work on desktop applications, having a rapid "hot swap" loop while debugging is incredibly important for productivity.

So right now I find myself bouncing back and forth between both IDEs; I prefer to use IntelliJ when I need to write large sections of code, but when it comes to debugging, I end up using Eclipse instead because of the superior experience for "hot swap".

There are a few other minor annoyances like the lack  of an option to reformat files on save like Eclipse does, or a minimal "new java class" dialog compared to Eclipse's, but overall I don't feel my money was wasted on the Ultimate edition.

I was wondering if anyone else has found ways to improve the performance of "hot swap" or knows of upcoming work being done on that feature?

4 comments
Comment actions Permalink

In the past IDEA had always followed a more traditional IDE approach. While it's make feature can be optimized  via a setting (and I believe it is by default) to only make files that have changed, it has always been a process that had to be manually launched, and you had to wait for it to complete.

IntelliJ IDEA 12 added a new compiler mode. With it, compilation is auto triggered by events within the IDE. So the code is constantly being compiled in the background. This does help speed up things. However, the one limitation when using the standard Java javac compiler is that it stops once an error is hit. This can slow things down since an error may occur early in the compilation process, leaving a lot of files remaining for compilation after you make your final edit before building/testing/running. In Eclipse, the Eclipse Compiler does not stop when it encounters an error. It continues to compile anything that is possible to compile despite the error. This is the Eclipse feature that makes "hot swapping" faster in Eclipse. So it is (to the best of my understanding since I have never used Eclipse) a feature of the Eclipse Compiler, and not the Eclipse IDE per se.  Well, the good news is that starting with IntelliJ IDEA 12, you can set the compiler [File > Settings (or Other Settings > Default Settings) > Compiler > Java Compiler > Use Compiler] to use the Eclipse Java Compiler (which is bundled with IDEA). This provides an additional setting to "Proceed on errors". This will give you an experience more like Eclipse. (Note that you could do this in versions prior to 12, but it required manually adding the  -proceedOnError option to the "Additional command line parameters" in the compiler. settings.)

There are some additional options to speed up compilation, such as "Compile independent modules in parallel". The following blog posts made during the development of IDEA 12 discuss some of the new compiler features. Be sure to read through the comments as there is some additional information in them as well.


I hope that helps.

    0
    Comment actions Permalink

    you don't have to save your files. they are automatically saved when pressing make.

    0
    Comment actions Permalink

    Yes, actually.  All of that does help somewhat.

    I found that by switching the compiler to Eclipse, disabling external builds, and by skipping the manual save step (that the other poster mentioned) before building that the edit -> compile -> test cycle is greatly improved.

    It's still not as fast as Eclipse's nearly instantaneous cycle, but it's close enough now that I've stopped opening Eclipse just to debug.

    However, there is one caveat to all of this -- namely that integration with the Eclipse compiler seems a bit buggy at the moment.  Often times when I'm editing and building I'll randomly get errors from the build claiming I'm using java features that aren't allowed by the current project level (my project level is 1.6, and it's complaining about 1.5 features), simply going to Build -> Rebuild Project always "fixes" these.

    If I manage to find a reproducible test case, I'll file a bug for that.  It doesn't happen often enough with my current project to be an impediment, but with my last project it was definitely getting annoying.

    Thanks for your earlier response, it was greatly appreciated.

    0
    Comment actions Permalink

    Does the Eclipse compiler handle aspects?

    0

    Please sign in to leave a comment.