Extremely poor performance of the Kotlin plugin for Eclipse


Not sure if this is the right place to report this, but seeing huge speed / memory allocation / leak problems when using Kotlin code of moderate size in Eclipse. The code is approximately 400 files, and about 20 KLOC. The code is referenced from a partner Java project.

When modifying Kotlin files in the workspace (all tend to be updated at once as testing cogen), I see the message in the build window:

“Update occurance annotations”.

Then it maxes out the CPU for about 2-4 minutes, meanwhile I can do nothing. The project isn’t that big.

This is the version of the Kotlin plugin:

I’m running on a machine with 12GB RAM, and The JVM is allocating 5GB for eclipse for Kotlin. It’s a 3.2Ghz i5 chip.

If there is a place to report this kind of issue, please direct me to the right place. Really loving Kotlin as a language but this issue is making me wonder if the syntactic sugar carries an IDE overhead makes it unsuitable for larger projects?

1 Like

I have investigated this issue and the reason this is happening is the way that the asynchronous task ‘Update occurance annotations’ is executed. This task is executed on every change of cursor position or text under cursor, regardles how frequent these changes are and whether the change has any effect on highligted identifiers.

This could be done to improve this situation:

  1. You should be able to turn off highligting completely
  2. There should be some delay before running the background task, so tho task will run after some user inactivity.
  3. Do not allow multiple simultaneous backround task of this type. Abort previous task before running another.
  4. Investigate whether it is possible to improve this task performance - it is slow event if it runs only once and subsequent runs are as slow as the first run, so there must be some way to cache previous results (if they are aplicable) in some way.

I have seen code of scala eclipse plugin and it provides functionality that I have described above. I will try to do it myself, but I do not promise anything becouse time is precious to me :o)

1 Like

Thank you for the explanation. It’s good to have it confirmed that I’m not imagining it.

It’s March 2019 and it still hasn’t been fixed. Kotlin is a joke.

If I am not mistaken the Kotlin plugin for Eclipse was discontinued. It may stil receiving some updates but it was meant as a starting point for Kotlin. You should really consider IntelliJ IDEA.
If you are using Gradle you could .gitignore all the IDE’s related files and use whatever IDE you want.
If you are not using Gradle nor IntelliJ IDEA… Boy you are brave, really good luck to you!

1 Like

You are mistaken, kotlin eclipse plugin is still developed, it was abandoned for some time because of resources shortage (no spare developers), but the project is quite active since September 2018, developers from JetBrains recently started to incorporate my, now outdated, fix to new version of the plugin, I hope it will be merged eventually.

I moved to IntellijIDEA (not because of the plugin, I used the fixed version with my changes) so it’s not an issue for me anymore, but I’m still keeping an eye on this.