Idea13 compiler performance

Hi guys.

I'm just trying out Idea13 and have big problems with compile performance.

Idea12 FSC
Clean Build: 5:23
Change file that nothing depends on: 1sec
Change file that a lot depends on: 2sec

Idea13
Clean Build: 7:36
Change file that nothing depends on: 44secs
Change file that a lot depends on: 1:19

Idea13 Parallel
Clean Build: 3:43
Change file that nothing depends on: 35secs
Change file that a lot depends on: 40secs

As you can see, clean build is faster than FSC when in parallel mode which is good but not that important as I don't do full builds very often. The big problem is when I just change a file, there is a major difference between FSC and new build system. It makes Idea13 unusable for us. I can't test out FSC in Idea13 as I can't seem to get it working, even when I turn off external build.

Unfortunately I've been busy for the past 6 months so haven't kept up to date with this forum/plugin development. Is this a known problem with a possible solution?

Thanks, Nick.

0
19 comments

Yes, we are on the way to add better incremental compiler, which will be much faster: https://github.com/JetBrains/intellij-scala/commit/f7fef673a183e4938ac1e72f31cb4687edae36d4
It's now in master, and not yet available in nightly builds. You can build plugin from master by yourself or to wait until next week, when nighly builds will be available.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

That's great news.

I will await it with anticipation!

Thanks, Nick.

0
Avatar
Permanently deleted user

Looking forward for updates, this is a show-stopper for me to perform updagrade to IDEA-13

0

Please try new compiler in version 0.27.395: http://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly+Builds+for+Cardea
To setup it please IDE Settings -> Scala -> Incremental compilation by: IntelliJ IDEA.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

Much better!

Idea13 Parallel with incremental compilation by idea
Clean Build: 3:21
Change file that nothing depends on: 2secs
Change file that a lot depends on: 3secs

Not sure why the clean build went faster. Other cases are 1 second longer than FSC but this is fine for me.

Thanks for the work,

Nick.

0
Avatar
Permanently deleted user

When do you think this will be released?


0

I hope for 9th January.

Best regards,
Alexander Podkhalyuzin.

0

what is the difference betweem the settings, and why are there two?

0

IntelliJ IDEA compiler is much faster, but it's possible that incremental make will fail (rare situations). For example known problem for Scalaz. If you have package object which contains class, which inherited from another class in the same package, then any change in that class will cause compiler error (due to compiler bug it tries to look into bytecode, which is deleted, instead of sources).

SBT based compiler uses dependency manager from SBT, which is more precise, but much slower, because it usually fails to detect right amount of classes, which should be recompiled.

The choice depends on what you are looking for.

Best regards,
Alexander Podkhalyuzin.

0

In version for the first 0.28.363 for the previous IDEA 13.0.2. EAP we had a bug with settings, so these two was the same (SBT based). Now it's fixed in 0.28.366, so probably this thing confused you.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

Well, intellij 13 scala build is probably fast, but in case of Idea-12 + FSC I can stop and start Play application and code will not be recompiled (restart is really fast, it's just a matter of seconds)
In case of Idea 13, start/stop of play application involve ALL classes recompilation (which is a matter of 10 .... 100 ... 1000 seconds depend on project size),
That automatically kill all the speed benefits which Idea-13 scala compiler may bring.

So that still prevents to switch to Idea-13, since 12+FSC is much faster option

IDEA-13 : #IU-133.696
Scala Plugin : 0.30.380

0

With Play plugin you will not use ordinary compiler (FSC, SBT based or new one) you will use something similar to command line "play compile". With running application you will not need to recompile, just reload page.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

Actually I generated IDEA project files for play project (http://www.playframework.com/documentation/2.2.x/IDE) with play "idea with-sources=yes"
Opened geneated project in Idea, create run configuration and set the compiler option to not use "external mode" (so FSC is used in IDEA-12). (so play console is used by me only on IDEA project generation phase )
After that I can run unit tests (and app itself) pretty fast. It is especially important for unit-tests, since it takes really smal time to start them with FSC (I really don't need to stop/start play app)

Just a simple compariosn. I have small play-project with 3 junit test classes with 5 test methods inside it.
IDEA-13
# total time to run: 23 seconds
## test execution time : 8 seconds (actual time spent in tests)
## time before test started = 23 - 8 = 15 seconds  (searching for compilable files, make, bla-bla-bla - time passed before test execution is started, on larger project it can be even larger).

IDEA-12 (without FSC)
# total time to run: 32 seconds
# Actulal time to run the tests (8 seconds)
## time before test started = 32 - 8 = 24 seconds  (project information, make, bla-bla-bla).

IDEA-12 (with FSC)
# total time to run: 9.5 seconds
# Actulal time to run the tests (8 seconds)
# time before test started = 9.5 - 8 = 1.5 seconds


So, yes IDEA-13 seems to be faster than IDEA-12 without FSC, but the initialization time before any tests is even started is uncomparable with FSC (which probably store all info in the memory and do not perform the ame initalization tasks every time)


Note: All measurments are done on 2-nd and 3-rd run of tests to ensure that all necessary "first time" initializations are done

Note: I'm for sure IDEA-13 fan but due to certain reasons can't use it for some tasks (especially if I need to run JUnit tests on play/scala project). BTW, I'm swithcing back to IDEA-13 now, since I have to write/run jasmine/karma JS tests

0

Do you use Server support for compilation in IntelliJ IDEA 13?

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

"Server support for compilation in IntelliJ IDEA 13?"
Is it controlled by Settings/Scala "Run compile server (in external build mode)?" checkbox ? If yes - than this checkbox was turned on.
Actually in both cases I see the same issue - significant amount of time is spent with message  "Searching for compilable files" (12 - 14 seconds)

0

It looks like you are using SBT based version of compiler. Starting from IDEA 13.0.2 you can try IDEA based compiler. This setting is on the same window as compiler server setting.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

Actually not, I'm using "Incremental compilation by"="Intellij IDEA", and "compilation order" = "Mixed"
it's actually make not so much difference, I believe compilation itself is quite fast (not sure how to check it), but before it is even started I see "searching for compilable files"

Question: could you please share the example of scala/java/play project (with some JUnit tests) with tests which could be launched(re-launched) fast from IDE ?
My only issue is with launching tests or stop/start application (with stop/start button, not after automatic recompile/restat of app after source code changed)



Attachment(s):
idea settings.png
0
Avatar
Permanently deleted user

It looks like it is a prformance issue - due to that I switch between 12 and 13 IDE all the time. Everytime I want to write/launch a lot JUnit test for play project - switch back to 12, once I need to use newest stuff - switch to 13
So, pobably it's worth to create a perfomance issue in the tracker ?

0
Avatar
Permanently deleted user

Creating an issue is definitely a good idea. It would be very helpful if you will attach an example of the project with this problem.

0

Please sign in to leave a comment.