kotlinx-benchmark

Benchmark Kotlin Multiplatform code across JVM, JS, Native, and Wasm targets.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill kotlinx-benchmark
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlinx-benchmark
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/kotlinx-benchmark
Command: npx skills add https://github.com/trancee/MeshLink-template --skill kotlinx-benchmark

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the difficulty of measuring performance across diverse Kotlin targets (JVM, JS, Native, Wasm) by providing a unified, annotation-driven framework that integrates directly into the Gradle build lifecycle.

Core Features & Use Cases

  • Multiplatform Support: Benchmark code consistently across JVM, JS, Native, and Wasm targets using a shared API.
  • JMH Integration: Leverages the industry-standard Java Microbenchmark Harness for high-precision JVM measurements.
  • Use Case: Use this Skill to identify performance bottlenecks in your cross-platform SDK by defining benchmark classes with @Benchmark annotations and running them via Gradle to compare throughput or latency across different configurations.

Quick Start

Run the kotlinx-benchmark skill to execute all defined benchmarks for the jvm target using the main configuration profile.

Frequently Asked Questions about kotlinx-benchmark

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I benchmark Kotlin Multiplatform code across different targets?

You can benchmark Kotlin Multiplatform code by defining benchmark classes with @Benchmark annotations and running them via Gradle. This framework supports JVM, JS, Native, and Wasm targets through a shared API.

What is the best way to measure performance for a cross-platform Kotlin SDK?

The best way to measure Kotlin SDK performance is using an annotation-driven framework that integrates with Gradle. It supports custom configuration profiles to compare throughput or latency across different targets.

Does kotlinx-benchmark support JMH for JVM measurements?

Yes, kotlinx-benchmark integrates the Java Microbenchmark Harness (JMH) to provide high-precision performance measurements specifically for JVM targets, ensuring accurate and standardized benchmarking results.

How are warmups and dead-code elimination handled during Kotlin benchmarking?

Kotlin benchmarking handles warmups and iteration control natively, and prevents dead-code elimination by using a Blackhole mechanism, ensuring the performance measurements remain accurate across all platforms.

Can I run benchmarks for the JVM target using a specific Gradle configuration profile?

Yes, you can execute benchmarks for the jvm target using the main configuration profile by running the corresponding Gradle build task, facilitating targeted performance analysis for your specific setup.