Does anyone else notice extremely poor performance...
# kotest
r
Does anyone else notice extremely poor performance of IntelliJ IDEA when editing kotest files? All versions I've tried. I'm not sure what it is about the kotest files that it doesn't like...
👍 1
Using WordSpec
w
Yes, it’s brought up every once in a while. It’s a Kotlin/IJ thingy, sadly. Afaik the only thing we can do for now is submit a ticket on youtrack and hope the issues are resolved in new Kotlin releases
r
😢 I'll raise a ticket with the data I have
Thanks!
l
I do believe there's a ticket available
@sam do you have the link easily?
w
I think Jetbrains folks encourage to just create tickets regardless, and they’ll figure out if it’s a duplicate that needs to be merged
s
I think there are several tickets floating about
I don't suffer from this issue myself, but I don't have 1500 line test files. Some things I've heard are slow in kotlin are lots of type parameters
l
I don't suffer with this either. My biggest test class is about 600 lines long
s
Kotlin can certainly be slow in the IDE in places but that's in normal files
I read somewhere that 1.4.20 is supposed to be much faster
l
I read the same about 1.4.10 and 1.4.0
☝️ 2
😂 5
xD
w
Well I just opened one of my specs, 350 lines: 6 seconds to even render the file, then another 12 seconds to analyze it
mother of god 2
s
If you uninstall the kotest plugin does it render any faster (I assume not, just like to rule things out)
w
Non-scientifically: it does seem faster, but I’m not eager to jump to conclusions. If I find some time I’ll try to profile a bit, see if there’s any measurable impact
s
like 6 seconds down to 2 seconds faster
or 6 seconds down to 5 seconds faster
w
Oh sorry, like initial 6 seconds to load was roughly the same (but also varied wildly), but then 12s down to ~6s for analysis
s
So the plugin is adding time to analyze - how big is the file
w
350 loc, 16 `describe`s, 29 `it`s. But also has utilities:
Copy code
private suspend fun DescribeScope.whenTimeAdvancesBy(duration: Duration, block: suspend DescribeScope.() -> Unit) =
    describe("when time advances by $duration") {
        Dispatchers.testMainDispatcher.advanceTimeBy(duration)
        block()
    }
and another similar one with two nested describes and an assertion. And like 5 mocks with generic params
s
I'll spend some time next week looking over the plugin to see if it's doing anything silly
👍 1
r
My tests aren't even that big or complex. I have one that's about 600 lines long. WordSpec, the most complex bit being that its taking in 6 generators in the checkAll function
yet the performance is terrible
eg.
Copy code
checkAll(Arb.string(), Arb.string().orNull(), Arb.string().orNull(), Arb.string().orNull())
I wonder if thats the reason
s
if you comment that out what happens
r
a 2 minute naive test (just commenting them all out and editing) returns IntelliJ to normal responsiveness
I'm going to try refactoring this to use checkAll, but with only 1 parameter and see what happens