Still strange, I can't really think of something t...
# announcements
k
Still strange, I can't really think of something that could cause it to take this long. It's not like your system is overloaded right? Or that something is taking up all disk reads?
g
Yes, it’s classloading
k
Probably, but a second for a couple of classes? Maybe the reflection package is larger than I thought.
g
a couple of classes? reflection library is about 2mb
also it’s about 300ms for me
k
Ah, that's fair.
c
So, in the commens of the original post we've determined that 300ms is only on first execution in REPL, afterwards no matter what you change all subsequent executions are in realm of 10-15ms, so it can be safely assumed first time is due to REPL init.
k
Well he's probably not running it in the REPL.
g
first time is due to REPL init
I reproduced it on pure Kotlin JVM project + gradle run, so it’s not related to REPL itself
c
Still cold start though
o
I am running with normal RUN
but yes... it's cold-start startup
In reality I wanted to write couple of lines of generic code where you give 2 classes, target class and depednecy graph... and it simply traverses all props of target class and matches same-name, assignable-type props from graph class and assigns them from graph to target... and noticed that exactly this first stuff does the evil 🙂
j
I noticed the delay too. It is definitely the initialization of the reflection library. It is heavier than you would expect. I don't have time today to show it with a performance profile though. Hopefully the reflection library initialization performance will be improved in the future
h
Are you on Windows? Most antivirus tools take a really long time to scan JARs.
j
Yep, Windows. I have excluded lots of directories (project, Gradle, IntelliJ IDEA) from scanning, but even then it is noticeable