how is kotlin so much faster than java while using...
# getting-started
h
how is kotlin so much faster than java while using the same bytecode?
a
Why do you think that kotlin is much faster?
👆 3
h
I tested them side by side after converting some java code
maybe i just need to more tests
a
how did you test it? with JMH?
p
Is your code doing the same things?
h
yeah, i literally just used the coverter from java to kotlin, but i'll test it again later. i imagine there should be no reason it does?
p
Well, in theory, since a lot of stuff is mutable in Java, but immutable in Kotlin, the compiler can do more optimisations. Otherwise ¯\_(ツ)_/¯
👍 1
h
okay!
yeah kotlin is just a lot safer than java. it's easier to understand, i think. it took a lot of the great conventions of newer languages, but didn't leave itself so weakly typed as languages like javascript
g
Dynamic languages also have some great advantages, like being able to having a ‘real’ repl. I’ve seen some comparisons between java and kotlin, but the differences weren’t that big, and sometimes kotlin was slower.
✍️ 1
k
@Hullaballoonatic home code testing hardly ever is reliable source of benchmarks.
🤝 1