Are there any tools available the can help benchmark some code in Kotlin?
I can use something similar to the approaches suggested here: http://www.ibm.com/developerworks
All low level benchmarking tools are the same that you would use for Java, since the byte-code is identical.
If by "Kotlin native tools" you mean syntactic sugar for measuring (relative) performance, then stdlib provides measureTimeMillis
and measureNanoTime
:
fun main(args: Array) {
val benchmark = measureNanoTime {
// some slow code here
}
}
The results may vary from run to run for obvious reasons, but it may help to estimate relative performance.