Re:Kotlin's hidden costs – Benchmarks
by richdougherty on Tuesday July 04, 2017 @06:12PM
(#14698663)
Summary: most stuff is within 5-10% of Java. In performance sensitive code be careful of the spread operator and foreach on ranges which have higher costs.
[ Parent
| on HN ]
Except the parts where Kotlin actually beats Java.
It was still within 5-10%, just on the other end of the scale!
Re:Kotlin's hidden costs – Benchmarks
by on_and_off on Wednesday July 05, 2017 @05:26AM
(#14700979)
Are these results relevant though ?
Kotlin is also costly when it needs to create an object in order to pass a function (like in a non inlined higher order function). So I would expect a comparison of the number of allocations too.
From there it gets tricky because it really depends on the JVM you are running on in order to determine if this is going to generate enough pressure on the GC in order to have pauses, but that's a potential cost.
Also .. in the end the results are not that different while the 2 languages have very different capabilities. Delegates, higher-order functions, nullability, data classes, ... Kotlin has a lot to offer.
Re:Kotlin's hidden costs – Benchmarks
by BurningFrog on Tuesday July 04, 2017 @10:09PM
(#14699575)
5-10% is 3-6 months of Moore's Law.
If it still held. "The free lunch is over" [1], and has been for years now.