$ the-wire · showcase
Pydantic targets schema-build fast paths, adds large-string JSON benchmarks
By RepoJournal · Filed · About FastAPI & Pydantic · Composed from the cited sources · methodology
Alexmojaki's two stacked PRs bypass general schema generation for empty annotation lists and flat builtin scalar unions, while Viicos landed benchmarks for serializing large strings to JSON.
Construct builtin scalar union schemas directly pydantic/pydantic
Unions composed entirely of exact types accepted by _is_simple_schema_type now build the known union/nullable dictionaries directly instead of passing every member through general schema generation. It stacks on the merged scalar entry-point fast paths and serves as the alternative to the union cache in #14131.
Skip annotation handler setup when annotations are empty pydantic/pydantic
The draft PoC returns early from _apply_annotations() when the annotations list is empty, calling the inner generation function with its transform, converting ref schemas to definition references, and still applying configured JSON encoders. It preserves the existing processing order, so custom transforms and encoders keep working on the short path.
Add benchmarks for serializing large strings to JSON pydantic/pydantic
Benchmarks for serializing large strings to JSON, from Viicos. It establishes a measurement for a path the schema work does not touch.
Add benchmarks for serializing large strings to JSON (#14207) pydantic/pydantic
The changeset for the same benchmark addition.