pydantic
pydantic
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Add schema generation benchmarks for models with custom serializers
#10290
Merged
Comparing
AdolfoVillalobos:test/03-09-2024-benchmark-schema-generation-with-custom-serializers
(
b2210c4
) with
main
(
91a4993
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
43
New
5
Dropped
0
Ignored
2
Benchmarks
New
test_custom_field_serializer_plain
tests/benchmarks/test_model_schema_generation.py::test_custom_field_serializer_plain
CodSpeed Performance Gauge
N/A
N/A
1.4 ms
test_custom_field_serializer_wrap
tests/benchmarks/test_model_schema_generation.py::test_custom_field_serializer_wrap
CodSpeed Performance Gauge
N/A
N/A
1.4 ms
test_custom_model_serializer_decorator
tests/benchmarks/test_model_schema_generation.py::test_custom_model_serializer_decorator
CodSpeed Performance Gauge
N/A
N/A
1.3 ms
test_custom_serializer_plain_annotated
tests/benchmarks/test_model_schema_generation.py::test_custom_serializer_plain_annotated
CodSpeed Performance Gauge
N/A
N/A
1.5 ms
test_custom_serializer_wrap_annotated
tests/benchmarks/test_model_schema_generation.py::test_custom_serializer_wrap_annotated
CodSpeed Performance Gauge
N/A
N/A
1.6 ms
Passed
test_complex_model_serialization
tests/benchmarks/test_model_serialization.py::test_complex_model_serialization
CodSpeed Performance Gauge
+2%
53.4 µs
52.5 µs
test_nested_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_nested_model_validation[model_validate]
CodSpeed Performance Gauge
+1%
56.7 µs
56.3 µs
test_list_of_models_serialization
tests/benchmarks/test_model_serialization.py::test_list_of_models_serialization
CodSpeed Performance Gauge
+1%
62.7 µs
62.3 µs
test_list_of_models_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_list_of_models_validation[model_validate]
CodSpeed Performance Gauge
0%
97.9 µs
97.4 µs
test_simple_model_serialization
tests/benchmarks/test_model_serialization.py::test_simple_model_serialization
CodSpeed Performance Gauge
0%
34.5 µs
34.3 µs
test_model_json_serialization
tests/benchmarks/test_model_serialization.py::test_model_json_serialization
CodSpeed Performance Gauge
0%
57.6 µs
57.3 µs
test_import_basemodel
tests/benchmarks/test_imports.py::test_import_basemodel
CodSpeed Performance Gauge
0%
84.1 µs
83.8 µs
test_efficiency_with_highly_nested_examples
tests/benchmarks/test_discriminated_unions.py::test_efficiency_with_highly_nested_examples
CodSpeed Performance Gauge
0%
971.7 µs
968.9 µs
test_import_field
tests/benchmarks/test_imports.py::test_import_field
CodSpeed Performance Gauge
0%
83.1 µs
82.9 µs
test_north_star_json_loads
tests/benchmarks/test_north_star.py::test_north_star_json_loads
CodSpeed Performance Gauge
0%
22.7 ms
22.7 ms
test_simple_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_simple_model_validation[model_validate]
CodSpeed Performance Gauge
0%
44.1 µs
44 µs
test_complex_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_complex_model_validation[__init__]
CodSpeed Performance Gauge
0%
57.8 µs
57.7 µs
test_custom_field_validator_via_decorator[after]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_decorator[after]
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_north_star_dump_python
tests/benchmarks/test_north_star.py::test_north_star_dump_python
CodSpeed Performance Gauge
0%
16.7 ms
16.7 ms
test_north_star_json_dumps
tests/benchmarks/test_north_star.py::test_north_star_json_dumps
CodSpeed Performance Gauge
0%
24.3 ms
24.3 ms
test_custom_field_validator_via_annotation[PlainValidator]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_annotation[PlainValidator]
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_simple.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
31.1 ms
31.1 ms
test_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_recursive_model_schema_generation
CodSpeed Performance Gauge
0%
1.9 ms
1.9 ms
test_north_star_validate_python
tests/benchmarks/test_north_star.py::test_north_star_validate_python
CodSpeed Performance Gauge
0%
44.7 ms
44.7 ms
test_simple_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_simple_model_schema_generation
CodSpeed Performance Gauge
0%
1.5 ms
1.5 ms
test_custom_field_validator_via_annotation[AfterValidator]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_annotation[AfterValidator]
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_lots_of_models_with_lots_of_fields
tests/benchmarks/test_model_schema_generation.py::test_lots_of_models_with_lots_of_fields
CodSpeed Performance Gauge
0%
4.5 s
4.5 s
test_north_star_validate_json_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_json_strict
CodSpeed Performance Gauge
0%
53.2 ms
53.2 ms
test_north_star_validate_json
tests/benchmarks/test_north_star.py::test_north_star_validate_json
CodSpeed Performance Gauge
0%
53.3 ms
53.4 ms
test_nested_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_nested_model_validation[__init__]
CodSpeed Performance Gauge
0%
60.3 µs
60.3 µs
test_schema_build
tests/benchmarks/test_discriminated_unions.py::test_schema_build
CodSpeed Performance Gauge
0%
3.6 ms
3.6 ms
test_construct_schema
tests/benchmarks/test_model_schema_generation.py::test_construct_schema
CodSpeed Performance Gauge
0%
4.9 ms
4.9 ms
test_custom_field_validator_via_decorator[plain]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_decorator[plain]
CodSpeed Performance Gauge
0%
1.5 ms
1.5 ms
test_custom_field_validator_via_annotation[BeforeValidator]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_annotation[BeforeValidator]
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_generics.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
256.1 ms
256.3 ms
test_north_star_validate_python_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_python_strict
CodSpeed Performance Gauge
0%
30 ms
30 ms
test_custom_wrap_field_validator_via_decorator
tests/benchmarks/test_model_schema_generation.py::test_custom_wrap_field_validator_via_decorator
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_custom_model_validator_after
tests/benchmarks/test_model_schema_generation.py::test_custom_model_validator_after
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_custom_model_validator_wrap
tests/benchmarks/test_model_schema_generation.py::test_custom_model_validator_wrap
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_custom_model_validator_before
tests/benchmarks/test_model_schema_generation.py::test_custom_model_validator_before
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_custom_wrap_field_validator_via_annotation
tests/benchmarks/test_model_schema_generation.py::test_custom_wrap_field_validator_via_annotation
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_complex_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_complex_model_schema_generation
CodSpeed Performance Gauge
0%
3.3 ms
3.4 ms
test_nested_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_nested_model_schema_generation
CodSpeed Performance Gauge
0%
3.6 ms
3.6 ms
test_north_star_dump_json
tests/benchmarks/test_north_star.py::test_north_star_dump_json
CodSpeed Performance Gauge
0%
30.7 ms
30.8 ms
test_list_of_models_validation[__init__]
tests/benchmarks/test_model_validation.py::test_list_of_models_validation[__init__]
CodSpeed Performance Gauge
0%
100 µs
100.2 µs
test_simple_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_simple_model_validation[__init__]
CodSpeed Performance Gauge
0%
42.9 µs
43 µs
test_isinstance_basemodel
tests/benchmarks/test_isinstance.py::test_isinstance_basemodel
CodSpeed Performance Gauge
0%
26.4 ms
26.5 ms
test_complex_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_complex_model_validation[model_validate]
CodSpeed Performance Gauge
0%
57.1 µs
57.3 µs
Ignored
test_custom_field_validator_via_decorator[before]
Ignored
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_decorator[before]
CodSpeed Performance Gauge
0%
1.5 ms
1.5 ms
test_nested_model_serialization
Ignored
tests/benchmarks/test_model_serialization.py::test_nested_model_serialization
CodSpeed Performance Gauge
+5%
46.4 µs
44 µs
Commits
Click on a commit to change the comparison range
Base
main
91a4993
+0.2%
test: separate benchmarks for custom field serializers
b2210c4
1 year ago
by AdolfoVillalobos
© 2025 CodSpeed Technology
Home
Terms
Privacy
Docs