Skip to content

Restore pytest-benchmark for local and manual profiling - #1113

Open
Siyet wants to merge 3 commits into
mainfrom
fix-profile-workflow-benchmark-flags
Open

Siyet wants to merge 3 commits into
mainfrom
fix-profile-workflow-benchmark-flags

Conversation

@Siyet

@Siyet Siyet commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Add pytest-benchmark back to the test-prof dependency group. This is required for benchmark execution with the existing --benchmark-* options in just test-perf and the Manual Profile workflow. When CodSpeed is enabled, its benchmark fixture is used instead.

The existing calibration options are accepted during argument parsing but are unused in the current tests. Restoring their effect is separate work; this PR only adds the missing dependency.

provinzkraut
provinzkraut previously approved these changes Jul 3, 2026

@ofek ofek 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.

Instead, can you please bring back support for the old, simpler benchmarks so that we can run them locally and with the manual CI trigger? I was going to myself actually so I would feel bad merging this and then adding much of this again shortly after.

@Siyet
Siyet force-pushed the fix-profile-workflow-benchmark-flags branch from f40e1b6 to 513cd64 Compare July 4, 2026 11:48
@Siyet Siyet changed the title Fix Profile workflow by dropping stale pytest-benchmark flags Restore pytest-benchmark for local and manual profiling Jul 4, 2026
@Siyet

Siyet commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor Author

@ofek good call, reworked to your suggestion. Instead of dropping the pytest-benchmark scaffolding, this just re-adds pytest-benchmark to test-prof. It was removed in #1075, which is what orphaned the --benchmark-* flags and crashed the workflow.

That restores the simple benchmarks for local runs and the manual profile trigger. I confirmed the two plugins coexist: without --codspeed, pytest-benchmark runs the benchmark fixture (walltime table); with --codspeed, codspeed instruments it and pytest-benchmark steps aside.

One thing still open from the old setup: the --calibrate/--rounds conftest options are accepted but no longer wired to anything (the bench/bench_config fixtures that consumed them were also removed in #1075, the tests now call benchmark.pedantic(...) directly). This PR doesn't touch that. If you want those knobs functional again it's a bit more surgery on the tests, happy to leave it to you since you mentioned wanting to take this, or fold it in here. Your call.

No rush on my end, just let me know what you think whenever you get a chance.

@codspeed

codspeed Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 139 untouched benchmarks
⏩ 135 skipped benchmarks1


Comparing fix-profile-workflow-benchmark-flags (81cf3aa) with main (3f67b34)

Open in CodSpeed

Footnotes

  1. 135 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@ofek

ofek commented Jul 4, 2026

Copy link
Copy Markdown
Member

I'll take on the work to bring them back, thanks!

@Siyet

Siyet commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Whatever's easiest for you: feel free to merge this and start on yours, or close it and just repeat the one line in your own PR since it's the only change here. I'll leave the fate of this one in your hands.

@Siyet

Siyet commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main in. Still the same one line: pytest-benchmark back in the test-prof group.

@ofek two months on, pytest-benchmark is still absent from the repo and .justfile:136 still appends --benchmark-name short --benchmark-disable-gc, so just test-perf <name> and profile.yml (just test-perf all --calibrate --rounds 10000) still die at collection. The last three Manual Profile runs, all on 2026-06-20, failed for exactly this; the last successful one was 2025-11-16.

Your changes-requested was against the earlier version of this PR, which removed the scaffolding instead. This one is the minimal form of the restoration you said you would take on, and it does not conflict with a larger one later.

Checked that it is safe for CodSpeed: codspeed.yml syncs the same group, and pytest-codspeed archives a foreign benchmark fixture and substitutes its own, so the benchmark counts are unchanged.

If you want to own the whole thing, say so and I will close this. Otherwise I plan to merge it in a few days as a CI fix.

@Siyet
Siyet requested review from ofek and provinzkraut September 8, 2026 09:30
@Siyet

Siyet commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor Author

@ofek @provinzkraut I have merged main into this branch. The change now consists only of restoring the missing pytest-benchmark dependency; the profiling infrastructure is retained.

Ofek, your changes-requested review concerned the earlier version that removed that infrastructure. Could you re-review the current version? Janek, could you review compatibility with CodSpeed?

@provinzkraut

provinzkraut commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

@Siyet I think we can just revert the whole codspeed stuff. It does not work as promised for us, and I see no value in keeping it

@Siyet

Siyet commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

CodSpeed workflow runs are now disabled for the whole repository. CI is green on this PR; merging is currently blocked only by ofek's earlier changes-requested review. @ofek pls take another look at the current version.

@Siyet
Siyet force-pushed the fix-profile-workflow-benchmark-flags branch from 81cf3aa to 59d1c94 Compare September 14, 2026 12:52

This branch has not been deployed

No deployments
Sign up for free to 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.

3 participants