Calculating and presenting benchmarks

#1

Python pytest has a great plugin benchmark (https://pypi.org/project/pytest-benchmark/) which enables a very easy setting up of a comparative benchmark of functions where the framework runs each function many times for many different data input and outputs a table of results to the console.

Does Kotlin (or Java) have anything at all similar?

#2

JMH - Java Microbench Harness probably what you are looking for.

Here is a good intro to the concepts. Although it is a bit old, it explains the basics and gives some examples.

Additionally, Duncan McGregor gave a talk at KotlinConf 2017 on benchmarking Kotlin language features. He has several blog posts on the subject as well, here is Part 1 (the rest are linked at the end of that page).

Hope that helps!

1 Like