Published October 20, 2024 | Version 0.0.2
Software Open

Tracing Performance Metrics in Kotlin Multiplatform Projects via Compile-Time Code Instrumentation (Source Code and Builds)

Contributors

  • 1. Institute for System Software, Johannes Kepler University Linz, Austria

Description

This artifact contains the software (titled k-perf) presented in the paper Tracing Performance Metrics in Kotlin Multiplatform Projects via Compile-Time Code Instrumentation by Markus Weninger at the 15th Symposium on Software Performance.

 

Table of contents (English)

repo-source-v0.0.2.zip contains the content of the k-perf repo at the time of paper publish.

game_of_life-plain.build.zip contains builds for JVM, JS and native (Windows / mingwX64) based on the unmodified code.

game_of_life-tracing.build.zip contains builds for JVM, JS and native (Windows / mingwX64) based on instrumented code that logs method execution times to execution traces.

Technical info (English)

# k-perf
Kotlin backend compiler plugin to generate performance execution traces, including example applications and trace analyzers

## Plugin

The compiler plugin project is located at `plugin/`.
Open the project in IntelliJ for development and refresh the Gradle cache.
The project contains unit tests that can be used for testing the plugin in a JVM environment.
To build and locally publish the plugin run `publishToMavenLocal`.

## Analyzers

At `analyzers/` we host execution trace analyzers.

### Call Graph Visualizer

At `analyzers/call_graph_visualizer` you can find a Python script to generate a DOT / Graphviz graph for a given trace file.

## Kotlin Multiproject (KMP) Examples

At `kmp-examples/` we host example Kotlin projects that can be compiled to different targets.

### CLI Game Of Life

This example is located at `kmp-examples/game_of_life-plain` (without tracing) and `kmp-examples/game_of_life-tracing` (with tracing enabled).
Open the project in IntelliJ for development and refresh the Gradle cache.
Gradle run tasks encompass `jvmRun`, `jsRun` and `runReleaseExecutableMingwX64` (and other native targets).

How does `kmp-examples/game_of_life-tracing` differ from `kmp-examples/game_of_life-plain`?
In `build.gradle.kts`, section `plugins`, the "tracing version" has a dependency on the `at.ssw.k-perf-measure-plugin` compiler plugin.
Further, it has a dependency to `kotlinx-io` so that the plugin can write to files.
If you want to use this version, you first have to publish the compiler plugin to local Maven, see section Plugin.

Files

game_of_life-plain.build.zip

Files (18.9 MB)

Name Size Download all
md5:4417315caa7471c4ba7c2c1b22b1c9d6
9.0 MB Preview Download
md5:222081872bc06407610f283f473a0e6b
9.4 MB Preview Download
md5:34d3cd889ba5cfc2b88991b1b3c1f196
423.5 kB Preview Download

Additional details

Software

Repository URL
https://github.com/NeonMika/k-perf
Programming language
Kotlin
Development Status
Wip