Skip to content

Instantly share code, notes, and snippets.

View TKaluza's full-sized avatar

Tim TKaluza

  • Germany
View GitHub Profile
@TKaluza
TKaluza / bench.py
Created June 7, 2025 22:32 — forked from jcrist/bench.py
A quick benchmark comparing msgspec (https://github.com/jcrist/msgspec), pydantic v1, and pydantic v2
"""A quick benchmark comparing the performance of:
- msgspec: https://github.com/jcrist/msgspec
- pydantic V1: https://docs.pydantic.dev/1.10/
- pydantic V2: https://docs.pydantic.dev/dev-v2/
The benchmark is modified from the one in the msgspec repo here:
https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_validation.py
I make no claims that it's illustrative of all use cases. I wrote this up