Skip to content

Commit 0a1b742

Browse files
committed
add benchmarking readme
1 parent a96d077 commit 0a1b742

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,28 @@ To run a simple example app showcasing the jextract (Java calling Swift) approac
111111
This will also generate the necessary sources (by invoking jextract, extracting the `Sources/ExampleSwiftLibrary`)
112112
and generating Java sources in `src/generated/java`.
113113

114+
## Benchmarks
115+
116+
You can run Swift [ordo-one/package-benchmark](https://github.com/ordo-one/package-benchmark) and OpenJDK [JMH](https://github.com/openjdk/jmh) benchmarks in this project.
117+
118+
Swift benchmarks are located under `Benchmarks/` and JMH benchmarks are currently part of the SwiftKit sample project: `Samples/SwiftKitSampleApp/src/jmh` because they depend on generated sources from the sample.
119+
120+
To run **Swift benchmarks** you can:
121+
122+
```bash
123+
cd Benchmarks
124+
swift package benchmark
125+
```
126+
127+
In order to run JMH benchmarks you can:
128+
129+
```bash
130+
cd Samples/SwiftKitSampleApp
131+
gradle jmh
132+
```
133+
134+
Please read documentation of both performance testing tools and understand that results must be interpreted and not just taken at face value. Benchmarking is tricky and environment sensitive task, so please be careful when constructing and reading benchmarks and their results. If in doubt, please reach out on the forums.
135+
114136
## User Guide
115137

116138
More details about the project and how it can be used are available in [USER_GUIDE.md](USER_GUIDE.md)

0 commit comments

Comments
 (0)