A Gradle Plugin to build and generate benchmarking results for KMP iOS benchmarks.
A KMP project needs to do something like:
plugins { id("androidx.benchmark.darwin") }
and then it can use the darwinBenchmark
block like so:
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" // Destination destination = "platform=iOS Simulator,name=iPhone 13,OS=15.2" // Or a target device id destination = "id=7F61C467-4E4A-437C-B6EF-026FEEF3904C" // The XCFrameworkConfig name xcFrameworkConfig = "AndroidXDarwinSampleBenchmarks" }
Example metrics look like:
{ "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 } ] } }