# Kotlin + JOOQ + Intellij 15 = SLOOOOW!

**URL:** <https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426>\
**Category:** Support\
**Created:** [January 20, 2016, 7:46pm UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426 "2016-01-20T19:46:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sungmin.park](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sungmin.park](https://discuss.kotlinlang.org/u/sungmin.park)\
**Post date:** [January 20, 2016, 7:46pm UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/1 "2016-01-20T19:46:29Z")

</div>

Everything works fine, but JOOQ relative auto compilation and code analysis are painfully slow.

```kotlin
import org.jooq.DSLContext

object MainKotlin {
    lateinit var context: DSLContext

    @JvmStatic
    fun main(args: Array<String>) {
        context.select().from // <-- From here Intellij will not respond.
    }
}

```

```java
import org.jooq.DSLContext;

public class MainJava {
    public static void main(String[] args) {
        DSLContext context = null;
        context.select().from // <- Works like Intellij.
    }
}

```

Here is a test project - [GitHub - sungmin-park/kotlin-jooq-test: Kotlin + JOOQ + Intellij 15 = SLOOOW](https://github.com/sungmin-park/kotlin-jooq-test)

Any ideas?

---

<div class="post-metadata">

**Author:** ![valentin1](https://avatars.discourse-cdn.com/v4/letter/v/8797f3/32.png) [@valentin1](https://discuss.kotlinlang.org/u/valentin1)\
**Post date:** [January 21, 2016, 4:40pm UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/2 "2016-01-21T16:40:07Z")

</div>

I downloaded the project and tried the code completion. It’s really slow at that location. It takes many seconds for the completion list to show up. But if I wait until that and try it again it becomes rather quick here and in all other points where I tried that. Do you experience the same or do you have slow completion all the time?

---

<div class="post-metadata">

**Author:** ![sungmin.park](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sungmin.park](https://discuss.kotlinlang.org/u/sungmin.park)\
**Post date:** [January 22, 2016, 1:22am UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/3 "2016-01-22T01:22:32Z")

</div>

```kotlin
import org.jooq.DSLContext
import org.jooq.impl.DSL

object MainKotlin {
    lateinit var context: DSLContext

    @JvmStatic
    fun main(args: Array<String>) {
        context.select(DSL.value(1)).from(DSL.dual()).orderBy(DSL.rand()).limit(10, 100).fetch { it.value1() } // Evaluate code caches.

        context.select(DSL.value(1)). // still slow.
    }
}

```

Sadly slow almost all the time.

Actually, slow code completion is not the major issue. I can handle that. Major problem is slow code analysis.

---

<div class="post-metadata">

**Author:** ![jmmk](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jmmk/32/1792_2.png) [@jmmk](https://discuss.kotlinlang.org/u/jmmk)\
**Post date:** [February 7, 2016, 9:09pm UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/4 "2016-02-07T21:09:59Z")

</div>

I have the exact same issue. This is bad enough to make jooq nearly unusable with Kotlin/IntelliJ.

---

<div class="post-metadata">

**Author:** ![lukas.eder](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lukas.eder/32/2551_2.png) [@lukas.eder](https://discuss.kotlinlang.org/u/lukas.eder)\
**Post date:** [February 8, 2016, 12:57pm UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/5 "2016-02-08T12:57:48Z")

</div>

Hello JetBrains folks, Lukas from the jOOQ team here.

I’m happy to help with the resolution of this issue, if I can. jOOQ makes heavy use of overloading + generics + varargs, which can be a bit of a challenge for type inference algorithms that aren’t implemented optimally (or if the type inference spec is too lenient).

Let me know if I can be of any assistance.

---

<div class="post-metadata">

**Author:** ![jayson.minard](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jayson.minard/32/1434_2.png) [@jayson.minard](https://discuss.kotlinlang.org/u/jayson.minard)\
**Post date:** [February 9, 2016, 10:14am UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/6 "2016-02-09T10:14:29Z")

</div>

Did you add an issue to [youtrack.jetbrains.com](http://youtrack.jetbrains.com)? That is the best place to report bugs, performance related or otherwise.

---

<div class="post-metadata">

**Author:** ![jayson.minard](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jayson.minard/32/1434_2.png) [@jayson.minard](https://discuss.kotlinlang.org/u/jayson.minard)\
**Post date:** [February 9, 2016, 10:17am UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/7 "2016-02-09T10:17:57Z")

</div>

I added this as [https://youtrack.jetbrains.com/issue/KT-10978](https://youtrack.jetbrains.com/issue/KT-10978)

In the future, please report bugs to YouTrack.

---

<div class="post-metadata">

**Author:** ![denis.zharkov](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@denis.zharkov](https://discuss.kotlinlang.org/u/denis.zharkov)\
**Post date:** [February 9, 2016, 10:47am UTC](https://discuss.kotlinlang.org/t/kotlin-jooq-intellij-15-sloooow/1426/8 "2016-02-09T10:47:02Z")

</div>

We are working on it.  
You can try out [dev version](https://teamcity.jetbrains.com/guestAuth/repository/download/bt345/694215:id/kotlin-plugin-1.0.1-dev-574.zip) where some major performance issues has been fixed.
