blob: e2cc7e6ebf2cd0314606fecbd039a4da5253dc54 [file] [log] [blame] [view]
Rahul Ravikumar9911e912022-09-23 11:17:21 -07001# Introduction
2
3A Gradle Plugin to build and generate benchmarking results for KMP iOS benchmarks.
4
5* Generates Skia Dashboard compatible results.
6* Automatically generates the XCode project, and runs benchmarks on a target device running iOS
7 or macOS (simulator or physical devices).
8
9# Usage
10
11A KMP project needs to do something like:
12
13```groovy
14plugins {
15 id("androidx.benchmark.darwin")
16}
17```
18
19and then it can use the `darwinBenchmark` block like so:
20
21```groovy
22darwinBenchmark {
23 // XCodegen Schema YAML
24 xcodeGenConfigFile = project.rootProject.file(
25 "benchmark/benchmark-darwin-samples-xcode/xcodegen-project.yml"
26 )
27 // XCode project name
28 xcodeProjectName = "benchmark-darwin-samples-xcode"
29 // iOS app scheme
30 scheme = "testapp-ios"
Rahul Ravikumar6f7a3112023-10-31 14:28:34 -070031
32 // Destination
Rahul Ravikumar26673fb2023-11-03 11:16:38 -070033 destination = "platform=iOS Simulator,name=iPhone 13,OS=15.2"
Rahul Ravikumar6f7a3112023-10-31 14:28:34 -070034 // Or a target device id
Rahul Ravikumar9911e912022-09-23 11:17:21 -070035 destination = "id=7F61C467-4E4A-437C-B6EF-026FEEF3904C"
Rahul Ravikumar6f7a3112023-10-31 14:28:34 -070036
Rahul Ravikumar9911e912022-09-23 11:17:21 -070037 // The XCFrameworkConfig name
38 xcFrameworkConfig = "AndroidXDarwinSampleBenchmarks"
39}
40```
41
42Example metrics look like:
43
44```json
45{
46 "key": {
47 "testDescription": "Allocate an ArrayList of size 1000",
48 "metricName": "Memory Peak Physical",
49 "metricIdentifier": "com.apple.dt.XCTMetric_Memory.physical_peak",
50 "polarity": "prefers smaller",
51 "units": "kB"
52 },
53 "measurements": {
54 "stat": [
55 {
56 "value": "min",
57 "measurement": 0.0
58 },
59 {
60 "value": "median",
61 "measurement": 0.0
62 },
63 {
64 "value": "max",
65 "measurement": 0.0
66 },
67 {
68 "value": "stddev",
69 "measurement": 0.0
70 }
71 ]
72 }
73}
74```