Skip to content

Support the pedantic API - #81

Merged
art049 merged 2 commits into
masterfrom
cod-955-allow-stateful-benchmark-replaying-setup-teardown-with
Jun 6, 2025
Merged

Support the pedantic API#81
art049 merged 2 commits into
masterfrom
cod-955-allow-stateful-benchmark-replaying-setup-teardown-with

Conversation

@art049

@art049art049 commented Jun 3, 2025

Copy link
Copy Markdown
Member

Fixes#77

We'll merge both after your PR @not-matthias

@art049
art049force-pushed the cod-955-allow-stateful-benchmark-replaying-setup-teardown-with branch from 209b49d to 57148a1CompareJune 5, 2025 20:22

@adriencacciaadriencaccia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

It would make sense to test the benchmark.pedantic function in tests/test_pytest_plugin_walltime.py

@art049
art049force-pushed the cod-949-support-pytest-benchmark-marker-attributes branch 2 times, most recently from 84605a0 to 22d4d33CompareJune 6, 2025 09:17
Base automatically changed from cod-949-support-pytest-benchmark-marker-attributes to masterJune 6, 2025 10:18
@art049

Copy link
Copy Markdown
MemberAuthor

Yep I'll add a nominal test for both!

@art049
art049force-pushed the cod-955-allow-stateful-benchmark-replaying-setup-teardown-with branch from 57148a1 to 9e0797eCompareJune 6, 2025 11:36
@codspeed-hq

codspeed-hqBot commented Jun 6, 2025

Copy link
Copy Markdown

CodSpeed Instrumentation Performance Report

Merging #81 will not alter performance

Comparing cod-955-allow-stateful-benchmark-replaying-setup-teardown-with (96fe457) with master (22d4d33)

Summary

✅ 57 untouched benchmarks

@art049
art049force-pushed the cod-955-allow-stateful-benchmark-replaying-setup-teardown-with branch from 9e0797e to 4875846CompareJune 6, 2025 11:44
@codspeed-hq

codspeed-hqBot commented Jun 6, 2025

Copy link
Copy Markdown

CodSpeed Walltime Performance Report

Merging #81 will degrade performances by 7.67%

Comparing cod-955-allow-stateful-benchmark-replaying-setup-teardown-with (96fe457) with master (22d4d33)

Summary

⚡ 7 improvements
❌ 21 regressions
✅ 29 untouched benchmarks

⚠️Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

BenchmarkBASEHEADChange
test_iir_filter_process3.1 µs3 µs+2.63%
test_iir_filter_set_coefficients[a_coeffs0-b_coeffs0]842.8 ns881.7 ns-4.41%
test_make_allpass5.1 µs5.3 µs-3.62%
test_make_bandpass5.3 µs5.6 µs-4.13%
test_make_highpass5.4 µs5.7 µs-5.44%
test_make_lowpass5.3 µs5.6 µs-5.03%
test_combination_lists[0-0]1.9 µs1.9 µs+2.34%
test_combination_sum[candidates0-8]10.7 µs11 µs-3.04%
test_depth_first_search[4]30.3 µs30.9 µs-2.07%
test_generate_all_combinations[0-0]1.3 µs1.3 µs-2.49%
test_generate_all_combinations[4-2]7 µs7.3 µs-3.77%
test_generate_all_combinations[5-4]9.9 µs10.2 µs-3.56%
test_generate_all_permutations[sequence0]158.2 µs161.7 µs-2.15%
test_generate_sum_of_subsets_soln[nums0-9]25.5 µs24.3 µs+4.79%
test_get_valid_pos[pos0-4]2.8 µs2.9 µs-3.26%
test_hamilton_cycle[graph0]28.2 µs27.6 µs+2.41%
test_match_word_pattern[aba-GraphTreesGraph]104.8 µs101.1 µs+3.61%
test_minimax[scores0]10.4 µs10.8 µs-4.37%
test_solve_maze[maze0]22.8 µs23.9 µs-4.56%
test_solve_power_sum[13-2]6.9 µs7 µs-2.71%
...............

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@art049
art049force-pushed the cod-955-allow-stateful-benchmark-replaying-setup-teardown-with branch from 4875846 to f38528dCompareJune 6, 2025 11:58
@art049
art049force-pushed the cod-955-allow-stateful-benchmark-replaying-setup-teardown-with branch from f38528d to 96fe457CompareJune 6, 2025 12:19
@art049
art049 merged commit 96fe457 into masterJun 6, 2025
@art049
art049 deleted the cod-955-allow-stateful-benchmark-replaying-setup-teardown-with branch June 6, 2025 12:25
@flying-sheep

Copy link
Copy Markdown
Contributor

Please revert the typing changes. E.g. args: tuple is just wrong.

self._called = False

def __call__(
self, target: Callable[..., T], *args: tuple, **kwargs: dict[str, Any]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this used to be correct, now it makes no sense at all.

what you changed it to is “each positional argument is a tuple, and each keyword argument is a dict”. So this is valid according to your typing:

benchmark(print, (), (1,2), file={})

but this is invalid according to your typing:

benchmark(print, "a", file="out.txt")

flying-sheep added a commit to flying-sheep/pytest-codspeed that referenced this pull request Jul 10, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support pytest-benchmark's pedantic API

3 participants

@art049@flying-sheep@adriencaccia