ordo-one / package-benchmark

Swift benchmark runner with many performance metrics and great CI support
Apache License 2.0
326 stars 25 forks source link

feat(minor): Improve metric api ergonomics (#175) #176

Closed hassila closed 1 year ago

hassila commented 1 year ago

Description

Improves ergonomics of benchmark metric selection to allow writing .all instead of BenchmarkMetric.all

How Has This Been Tested?

Manual tests.

Minimal checklist:

codecov[bot] commented 1 year ago

Codecov Report

Merging #176 (d4b20f2) into main (615be32) will decrease coverage by 0.41%. The diff coverage is 75.34%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176/graphs/tree.svg?width=650&height=150&src=pr&token=hXHmhEG1iF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one)](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one) ```diff @@ Coverage Diff @@ ## main #176 +/- ## ========================================== - Coverage 71.42% 71.01% -0.41% ========================================== Files 26 26 Lines 3446 3470 +24 ========================================== + Hits 2461 2464 +3 - Misses 985 1006 +21 ``` | [Files Changed](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one) | Coverage Δ | | |---|---|---| | [Benchmarks/Histogram/Histogram.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-QmVuY2htYXJrcy9IaXN0b2dyYW0vSGlzdG9ncmFtLnN3aWZ0) | `44.96% <ø> (ø)` | | | [...urces/Benchmark/BenchmarkExecutor+Extensions.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrRXhlY3V0b3IrRXh0ZW5zaW9ucy5zd2lmdA==) | `70.00% <ø> (ø)` | | | [Sources/Benchmark/BenchmarkResult.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrUmVzdWx0LnN3aWZ0) | `74.44% <ø> (ø)` | | | [Sources/Benchmark/BenchmarkRunner.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrUnVubmVyLnN3aWZ0) | `60.00% <0.00%> (ø)` | | | [...urces/Benchmark/BenchmarkThresholds+Defaults.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrVGhyZXNob2xkcytEZWZhdWx0cy5zd2lmdA==) | `32.14% <ø> (ø)` | | | [Sources/Benchmark/Blackhole.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmxhY2tob2xlLnN3aWZ0) | `25.00% <0.00%> (-75.00%)` | :arrow_down: | | [Sources/Benchmark/BenchmarkMetric+Defaults.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrTWV0cmljK0RlZmF1bHRzLnN3aWZ0) | `38.95% <14.29%> (-7.00%)` | :arrow_down: | | [...stemStats/OperatingSystemStatsProducer+Linux.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvT3BlcmF0aW5nU3lzdGVtU3RhdHMvT3BlcmF0aW5nU3lzdGVtU3RhdHNQcm9kdWNlcitMaW51eC5zd2lmdA==) | `94.89% <94.64%> (ø)` | | | [Tests/BenchmarkTests/BenchmarkTests.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-VGVzdHMvQmVuY2htYXJrVGVzdHMvQmVuY2htYXJrVGVzdHMuc3dpZnQ=) | `96.43% <100.00%> (ø)` | | | [Files Changed](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one) | Coverage Δ | | |---|---|---| | [Benchmarks/Histogram/Histogram.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-QmVuY2htYXJrcy9IaXN0b2dyYW0vSGlzdG9ncmFtLnN3aWZ0) | `44.96% <ø> (ø)` | | | [...urces/Benchmark/BenchmarkExecutor+Extensions.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrRXhlY3V0b3IrRXh0ZW5zaW9ucy5zd2lmdA==) | `70.00% <ø> (ø)` | | | [Sources/Benchmark/BenchmarkResult.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrUmVzdWx0LnN3aWZ0) | `74.44% <ø> (ø)` | | | [Sources/Benchmark/BenchmarkRunner.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrUnVubmVyLnN3aWZ0) | `60.00% <0.00%> (ø)` | | | [...urces/Benchmark/BenchmarkThresholds+Defaults.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrVGhyZXNob2xkcytEZWZhdWx0cy5zd2lmdA==) | `32.14% <ø> (ø)` | | | [Sources/Benchmark/Blackhole.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmxhY2tob2xlLnN3aWZ0) | `25.00% <0.00%> (-75.00%)` | :arrow_down: | | [Sources/Benchmark/BenchmarkMetric+Defaults.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvQmVuY2htYXJrTWV0cmljK0RlZmF1bHRzLnN3aWZ0) | `38.95% <14.29%> (-7.00%)` | :arrow_down: | | [...stemStats/OperatingSystemStatsProducer+Linux.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-U291cmNlcy9CZW5jaG1hcmsvT3BlcmF0aW5nU3lzdGVtU3RhdHMvT3BlcmF0aW5nU3lzdGVtU3RhdHNQcm9kdWNlcitMaW51eC5zd2lmdA==) | `94.89% <94.64%> (ø)` | | | [Tests/BenchmarkTests/BenchmarkTests.swift](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one#diff-VGVzdHMvQmVuY2htYXJrVGVzdHMvQmVuY2htYXJrVGVzdHMuc3dpZnQ=) | `96.43% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one). Last update [615be32...d4b20f2](https://app.codecov.io/gh/ordo-one/package-benchmark/pull/176?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ordo-one).
github-actions[bot] commented 1 year ago

Pull request benchmark comparison [ubuntu-latest] with 'main' run at 2023-08-16T09:25:35+00:00 Pull request had performance regressions