A Better Way to Explore kotlinx-benchmark Results with Kotlin Notebooks | The Kotlin Blog
Blog post from JetBrains
Benchmarking in Kotlin is enhanced by using Kotlin notebooks, which provide a more interactive and visual approach to interpreting performance data generated by the kotlinx-benchmark library. While raw text results from benchmarking can be limiting, Kotlin notebooks allow developers to load results as structured data, explore them using the DataFrame API, and visualize them with charts. This method offers a clear and immediate overview of performance variations and stability across different implementations or hardware setups. Additionally, Kotlin notebooks facilitate the comparison of benchmark results from different environments or code commits by enabling the analysis and plotting of data, which can be read from JSON files generated by kotlinx-benchmark and converted into typed DataFrames. These notebooks support statistically rigorous comparisons by accounting for confidence intervals and offer features for sharing and publishing results, such as creating GitHub gists or using JetBrains Datalore for online viewing. This workflow not only improves understanding but also aids in the reproducible tracking of performance metrics within a team.