Kotlin + JOOQ + Intellij 15 = SLOOOOW!

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

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.
    }
}
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

Any ideas?

1 Like

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?

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.

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

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.

1 Like

Did you add an issue to youtrack.jetbrains.com? That is the best place to report bugs, performance related or otherwise.

I added this as https://youtrack.jetbrains.com/issue/KT-10978

In the future, please report bugs to YouTrack.

We are working on it.
You can try out dev version where some major performance issues has been fixed.