Adding support for new thresholds subcommands - used for storing/reading/checking against static saved thresholds - by default output into Thresholds in the current directory, but location can be specified with --path too.
To clarify, the existing thresholds in the benchmark code configuration is really threshold tolerances - unfortunately difficult to rename now, but basically the new thresholds commands operate on static thresholds, while the code defined tolerances continue to be applied to both dynamic and static benchmark checking as outlined in the documentation.
New thresholds support
Update static thresholds (in the Thresholds/ directory)
swift package --allow-writing-to-package-directory benchmark thresholds update
Build of product 'BenchmarkTool' complete! (2.44s)
Build complete!
Building BenchmarkTool in release mode...
Building benchmark targets in release mode for benchmark run...
Building URLBenchmarks
Building StringBenchmarks
Building PredicateBenchmarks
Building JSONBenchmarks
Building InternationalizationBenchmarks
Building FormattingBenchmarks
Building EssentialsBenchmarks
Building DataIOBenchmarks
Building Base64Benchmarks
Building AttributedStringBenchmarks
==================
Running Benchmarks
==================
100% [------------------------------------------------------------] ETA: 00:00:00 | AttributedStringBenchmarks:createLongString-swift
100% [------------------------------------------------------------] ETA: 00:00:00 | AttributedStringBenchmarks:createManyAttributesString-swift
100% [------------------------------------------------------------] ETA: 00:00:00 | AttributedStringBenchmarks:enumerateAttributes-swift
100% [------------------------------------------------------------] ETA: 00:00:00 | AttributedStringBenchmarks:enumerateAttributesSlice-swift
....
100% [------------------------------------------------------------] ETA: 00:00:00 | URLBenchmarks:URLComponents-SetEncodableComponents
100% [------------------------------------------------------------] ETA: 00:00:00 | URLBenchmarks:URLComponents-SetEncodableQueryItems
100% [------------------------------------------------------------] ETA: 00:00:00 | URLBenchmarks:URLComponents-SetQueryItems
==================
Writing Thresholds
==================
Writing to ./Thresholds/PredicateBenchmarks.predicateKeypathComputedPropertyCondition.p90.json
Writing to ./Thresholds/PredicateBenchmarks.predicateTrivialCondition.p90.json
Writing to ./Thresholds/StringBenchmarks.read-utf8.p90.json
...
Description
Adding support for new thresholds subcommands - used for storing/reading/checking against static saved thresholds - by default output into
Thresholds
in the current directory, but location can be specified with--path
too.To clarify, the existing thresholds in the benchmark code configuration is really threshold tolerances - unfortunately difficult to rename now, but basically the new
thresholds
commands operate on static thresholds, while the code defined tolerances continue to be applied to both dynamic and static benchmark checking as outlined in the documentation.New thresholds support
Update static thresholds (in the Thresholds/ directory)
Reading thresholds
Check static thresholds
Should address: https://github.com/ordo-one/package-benchmark/issues/265 https://github.com/ordo-one/package-benchmark/issues/268 https://github.com/ordo-one/package-benchmark/issues/269 https://github.com/ordo-one/package-benchmark/issues/271 https://github.com/ordo-one/package-benchmark/issues/275 https://github.com/ordo-one/package-benchmark/issues/282
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Minimal checklist:
DocC
code-level documentation for any public interfaces exported by the package