Closed MahdiBM closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 65.32%. Comparing base (
75e8622
) to head (a19235e
). Report is 13 commits behind head on main.
Thanks for the PR, I will try to review soonish, I am out of office this week, so it will take some time.
No worries, no rush, thanks 🙏.
I wonder if this has now made the tool run the benchmarks again? I can't tell properly, I'll have to do some investigations.
Ok apparently there are regressions in Swift 6 Linux toolchains, ranging from significant to absolutely-massive ... that might have been why it made me think it's rerunning the benchmarks. Still investigating.
Could you give this a try using https://github.com/ordo-one/package-benchmark/pull/284 instead, I think it should be sorted.
Description
Resolves #275 by loading benchmarks when they should be loaded.
How Has This Been Tested?
Click to show benchmark code
```swift let benchmarks = { Benchmark.defaultConfiguration = .init( metrics: [.cpuTotal], timeUnits: .nanoseconds, warmupIterations: 1, scalingFactor: .one, maxDuration: .seconds(1000), maxIterations: 1 ) func defaultCounter() -> Int { 10 } func dummyCounter(_ count: Int) { for index in 0 ..< count { blackHole(index) } } Benchmark( "CountNumbersBenchmark", configuration: .init( scalingFactor: .kilo, thresholds: [ .cpuTotal: .init( /// Tolerate up to 1% of difference compared to the threshold. relative: [.p90: 1], /// Tolerate up to 80ms of difference compared to the threshold. absolute: [.p90: 80_000_000] ) ] ) ) { _ in for _ in 0 ... 1_000_000 { dummyCounter(defaultCounter() * 1000) } } } ```Right now, the following is the result of the benchmark, with fixes applied:
✅ Pull request has no significant performance differences ✅
Benchmark check running at 2024-09-18 02:48:03 UTC
Baseline mmbm-no-twice-benchmark-run is EQUAL to the defined absolute baseline thresholds. (--check-absolute)
Baseline mmbm-no-twice-benchmark-run
MyBenchmarks
CountNumbersBenchmark
As you can see, the result shows
7710000
aka7.71s
of cpu time (now that I look, thatns
label must be a bug, probably caused by the scaling factor usage. See benchmark code above). But the threshold file is:Without this fix, this check would fail since the numbers are not equal. With this fix, the benchmark completes successfully since it does load the threshold tolerances as declared in the benchmark code:
Minimal checklist:
DocC
code-level documentation for any public interfaces exported by the package