arrow-kt / ank

ΛNK: Compile time docs verification and evaluation for Kotlin and Java (Temporarily moved to Arrow-kt)
https://github.com/arrow-kt/arrow/tree/master/modules/ank
Apache License 2.0
53 stars 3 forks source link

Ank build very slow under some circumstances #32

Open dgoetsch opened 6 years ago

dgoetsch commented 6 years ago

Hello, I am running ank against some documentation I wrote. I am seeing runAnk take 20+ minutes and pegging one processor. I killed the process around 28:30.

ank-performance

Through process of elimination, I determined that the specific code block contains a data class which inherits from its members via by.

data class AppTroupe(val sqlTroupe: SqlTroupe, val queuePublishTroupe: QueuePublishTroupe, val serializeTroupe: SerializeTroupe):
        SqlTroupe by sqlTroupe,
        QueuePublishTroupe by queuePublishTroupe,
        SerializeTroupe by serializeTroupe

I am working around this by excluding the code with by from ank. I've pushed the fix to a branch in my respository for the sake of an example.

I don't yet know the full scope of this issue.

dgoetsch commented 6 years ago

Correction: I was wrong about the cause. Its not necessarily the by keyword.

pakoito commented 6 years ago

Do you have any coroutines code inside the snippet, or anything asynchronous or with many sub-scopes? We've seen that causing issues before because it has to be rewritten and interpreted on the fly.

pakoito commented 6 years ago

I have to comment that this isn't necessarily blocked by Ank work, but rather on the underlying interpreter that sadly we don't control. As it improves, so will Ank improve with it :D