-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(minor): Enable Swift 6 mode and support specifying units per met…
…ric (#309) ## Description Swift 6 benchmark targets should now be possible with: ```swift let benchmarks: @sendable () -> Void = { ... } ``` Make it possible to specify output units for the text output for a given metric by specifying it in the configuration. E.g. ```swift Benchmark.defaultConfiguration.units = [.peakMemoryResident: .mega, .peakMemoryVirtual: .giga] ``` Also add the ability to override the time units from the command line using `--time-units`. E.g. ```bash swift package benchmark --time-units microseconds ``` This update also displays overflowing numeric values in scientific notation in the text output: ``` ╒═══════════════════════════════════════════════════════════════════════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╕ │ Test │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │ ╞═══════════════════════════════════════════════════════════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡ │ Samples:All metrics, full concurrency, async (ns) * │ 8.08e+07 │ 8.34e+07 │ 8.38e+07 │ 8.40e+07 │ 8.41e+07 │ 8.46e+07 │ 8.49e+07 │ 183 │ ├───────────────────────────────────────────────────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤ │ Samples:Counter, custom metric thresholds (ns) * │ 2375 │ 2417 │ 2417 │ 2459 │ 2501 │ 2709 │ 4334 │ 4753 │ ├───────────────────────────────────────────────────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤ │ Samples:Extended + custom metrics (ns) * │ 1875 │ 2000 │ 2000 │ 2041 │ 2167 │ 2667 │ 8750 │ 707 │ ├───────────────────────────────────────────────────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤ │ Samples:Extended metrics (ns) * │ 1750 │ 1875 │ 1875 │ 1917 │ 1958 │ 2209 │ 3250 │ 705 │ ╘═══════════════════════════════════════════════════════════════════════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╛ ``` Also updates documentation. Addresses: #306 and #237 #293 #277 #258 --------- Co-authored-by: Axel Andersson <axel@ordo.one> Co-authored-by: dimlio <122263440+dimlio@users.noreply.github.com>
- Loading branch information
1 parent
51fffb6
commit 2bb8a39
Showing
26 changed files
with
354 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ builder: | |
configs: | ||
- documentation_targets: [Benchmark] | ||
platform: linux | ||
swift_version: '5.10' | ||
swift_version: '6.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.