Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions bench/bench_kotlin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

## Run benchmarks

```shell
./gradlew bench
```

## Results of benchmarking

Note: Warm-up=10 and Iteration=5

```
Benchmark Mode Cnt Score Error Units
TestFloat.all thrpt 15 3119.965 ± 787.947 ops/s
TestRational.all thrpt 15 7264.325 ± 2229.145 ops/s
TestTrigoFloat.all thrpt 15 324.178 ± 58.267 ops/s
TestTrigoRational.all thrpt 15 0.548 ± 0.015 ops/s
```
42 changes: 42 additions & 0 deletions bench/bench_kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.20"
id("org.jetbrains.kotlinx.benchmark") version "0.4.5"
}

group = "math"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
}

dependencies {
testImplementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.5")
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm:0.4.5")
}

tasks.test {
useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

benchmark {
configurations {
named("main") {
iterations = 5 // number of iterations
iterationTime = 300
iterationTimeUnit = "ns"
warmups = 10
advanced("jvmForks", 3)
}
}
targets {
register("test")
}
}
1 change: 1 addition & 0 deletions bench/bench_kotlin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
Binary file not shown.
5 changes: 5 additions & 0 deletions bench/bench_kotlin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
234 changes: 234 additions & 0 deletions bench/bench_kotlin/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions bench/bench_kotlin/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading