https://kotlinlang.org logo
#kotest
Title
# kotest
d

dimsuz

03/06/2023, 4:03 PM
I observe a dramatic typing lag increase and general IDE unresponsiveness when editing a certain koTest file. It contains a ShouldSpec and is about 1000 lines long (oh, actually exactly 1000, heh). I recall that several years ago there was a similar issue with the
Spec
test framework and it was related to the fact that there is a big lambda, wrapping everything here:
Copy code
class MyTest : ShouldSpec(<big_lambda>)
I'm here to ask if anyone can provide me with the YouTrack link or something which I could track and report further findings — I suspect this is a known issue. P.S. In Spec-days it seemed to get improved, but maybe not enough...
e

Emil Kantis

03/06/2023, 4:05 PM
Is the typing-lag still there if you disable the Kotest plugin?
d

dimsuz

03/06/2023, 4:10 PM
I guess I'l have to also restart? Actually it maybe not exactly typing lag, although it does happen often, but certainly a) syntax highlight lag — after I copy-paste something, code/errors get highlighted after about 5 seconds which is ridiculous b) I constantly see "Resolving pasted code imports" in the status line, which normally happens instantly.
e

Emil Kantis

03/06/2023, 4:14 PM
I think so. I'm asking because I remember seeing such a report but where JB said that the Kotest plugin was the culprit.
Is the Spec publicly available?
w

wasyl

03/06/2023, 4:19 PM
I recall one related issue that was primarily caused by passing the test lambda directly to the constructor. Using an
init
block instead resolved the issue, maybe it'll help for you too?
d

dimsuz

03/06/2023, 4:27 PM
Yep, Spek (I mistyped) is here.
Using an
init
block instead
Oh right! I recall this was earlier solution too. I'll try it!
a

alex.krupa

03/07/2023, 12:16 PM
Wow, switching to
init
made a huge difference, thanks! Our 3kLOC spec is actually editable now.
d

dimsuz

03/07/2023, 2:48 PM
I wish these issues wouldn't exist at all in our modern age with modern hardware 🥲 3kLOC really should be nothing to my beast of processor 🙂
Even if I change to init style and then edit the same file in Emacs — it feels sooo snappy (and syntax HL is enabled too of course). But only basic completion. Still I think it shouldn't be that much of an influence...
5 Views