Skip to content

Conversation

davidhewitt
Copy link
Contributor

Change Summary

This is an experiment to see what happens if definition inlining is implemented inside SchemaValidator. This should avoid the need to do it in Python (in the clean_schema function).

Hoping this has performance benefits.

Not fully implemented yet, there's some test diffs due to changes in the recursion defenses, I think I know how to resolve.

Related issue number

N/A

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Copy link

codspeed-hq bot commented Sep 29, 2025

CodSpeed Performance Report

Merging #1800 will improve performances by 31.39%

Comparing dh/inline-definitions (8e49e77) with main (ed0d1ca)

Summary

⚡ 1 improvement
✅ 162 untouched

Benchmarks breakdown

Benchmark BASE HEAD Change
test_definition_out_of_tree 991.3 µs 754.5 µs +31.39%

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