Skip to content

Build first CallSpec2 batch without empty setmulti copies#9

Open
adamtheturtle wants to merge 1 commit into
mainfrom
adamtheturtle/faster-collect-callspec-first
Open

Build first CallSpec2 batch without empty setmulti copies#9
adamtheturtle wants to merge 1 commit into
mainfrom
adamtheturtle/faster-collect-callspec-first

Conversation

@adamtheturtle

Copy link
Copy Markdown
Owner

Summary

  • On the first parametrize() call, construct CallSpec2 directly instead of setmulti() on an empty spec.

Timing (pytest's own testing/ suite)

Warm interleaved A/B pytest testing/ --collect-only -q (8 pairs).

Median
main 0.510s
This change 0.485s
Delta +0.025s (+4.9%)

Collected 4286 tests each run.

Note: this suite is only ~4k tests / ~0.5–1.5s collect, so single micro-optimizations are often within run-to-run noise.

Test plan

  • testing/python/metafunc.py

Made with Cursor

The initial parametrization used setmulti() on an empty CallSpec2, copying
empty maps for every parameter set. Construct CallSpec2 directly instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant