A Gradle Plugin to build and generate benchmarking results for KMP iOS benchmarks.
* Generates Skia Dashboard compatible results.
* Automatically generates the XCode project, and runs benchmarks.
A KMP project needs to do something like:
```groovy
plugins {
id("androidx.benchmark.darwin")
}
```
and then it can use the `darwinBenchmark` block like so:
```groovy
darwinBenchmark {
// XCodegen Schema YAML
xcodeGenConfigFile = project.rootProject.file(
"benchmark/benchmark-darwin-samples-xcode/xcodegen-project.yml"
)
// XCode project name
xcodeProjectName = "benchmark-darwin-samples-xcode"
// iOS app scheme
scheme = "testapp-ios"
// ios 13, 15.2
destination = "id=7F61C467-4E4A-437C-B6EF-026FEEF3904C"
// The XCFrameworkConfig name
xcFrameworkConfig = "AndroidXDarwinSampleBenchmarks"
}
```
Test: ./gradlew --no-configuration-cache :benchmark:benchmark-darwin-samples:darwinBenchmarkResults
Example metric:
```json
{
"key": {
"testDescription": "Allocate an ArrayList of size 1000",
"metricName": "Memory Peak Physical",
"metricIdentifier": "com.apple.dt.XCTMetric_Memory.physical_peak",
"polarity": "prefers smaller",
"units": "kB"
},
"measurements": {
"stat": [
{
"value": "min",
"measurement": 0.0
},
{
"value": "median",
"measurement": 0.0
},
{
"value": "max",
"measurement": 0.0
},
{
"value": "stddev",
"measurement": 0.0
}
]
}
}
```
Bug: b/253517578
Change-Id: Id7c9cbf0e33b76566caa3d5210ad06f43109d435
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 6bef6a7..5fd4854 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -82,6 +82,7 @@
apacheAnt = { module = "org.apache.ant:ant", version = "1.10.11" }
apacheCommonsCodec = { module = "commons-codec:commons-codec", version = "1.15" }
apacheCommonIo = { module = "commons-io:commons-io", version = "2.4" }
+apacheCommonsMath = { module = "org.apache.commons:commons-math3", version = "3.6.1" }
assertj = { module = "org.assertj:assertj-core", version = "3.23.1" }
asm = { module = "org.ow2.asm:asm", version.ref = "asm"}
asmCommons = { module = "org.ow2.asm:asm-commons", version.ref = "asm"}