We have a project on IDEA that consists of a couple med sized Java packages and one very small Kotlin package (5 files). I noticed performance is fine with any Java packages, but it's 10x slower in autocompletion, code analysis and compilation for the very small Kotlin package. Autocompletion occasionally was so slow to a point where the popover couldn't load all the methods and it had to load a couple API incrementally. Every time our developer types a word and wait for autocomplete, it takes about 2-5 seconds for the expected autocomplete to show up. Sometimes autocomplete was too slow to show anything, and we had to cancel the word and retyped it and waited. Same slowness occurs in code analysis. This is significantly impacting my team's productivity. From our research, it appears this is a well-known long lasting issue. This also happens for our another small project. I was wondering what we can do to fix this? Thanks.
Kotlin plugin is latest, Version: 1.1.3-release-IJ2017.2-2 Intellij is also on latest version, 2017 2.1 (built on July 31 2017)
The problem visible in your snapshot is resolved in Kotlin 1.1.4. As of this writing, it's available as an EAP (Early Access Preview) release; the final version will be released soon (and bundled with IntelliJ IDEA 2017.2.2).
Still happens in Kotlin 1.3.50. Got resolved by disabling Add unambiguous imports on the fly
in Settings > Editor > General > Auto Import
I've reached out to JetBrian and submitted a request to YouTrack. After reviewing the CPU snapshot, looks like upgrading the Kotlin plugin 1.1.4-eap which includes a major fix in performance will fix the issue. Just tried it and it worked!
来源:https://stackoverflow.com/questions/45581424/extremely-slow-in-autocompletion-code-analysis-for-kotlin-projects-in-intellij