Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Trimming str before parsing to int and float

#1203Merged
Comparing
hungtsetse:trim-str
(
6d65143
) with
main
(
47aff70
)
CodSpeed Performance Gauge
0%
Regression
2
Untouched
146

Benchmarks

148 total
test_small_class_core_dict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
-12%
21.5 µs24.4 µs
test_core_future
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
-10%
28.8 µs32.1 µs
test_strict_union_error_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUnion
CodSpeed Performance Gauge
+4%
33.4 µs32.2 µs
test_core_future_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+2%
19 µs18.6 µs
test_validate_literal[python-many_ints]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
14.7 µs14.4 µs
test_list_of_dict_models_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
135.5 µs133 µs
test_core_python
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+2%
31.9 µs31.3 µs
test_core_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+2%
21.9 µs21.5 µs
test_core_future_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+2%
22.2 µs21.8 µs
test_date_from_datetime_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+2%
20.6 µs20.3 µs
test_core_future
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+1%
20.3 µs20 µs
test_validate_literal[python-few_ints]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14.5 µs14.3 µs
test_validate_literal[json-few_mixed]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
20.5 µs20.2 µs
test_date_from_datetime
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+1%
24.3 µs24 µs
test_core_string_strict_wrong_str_e
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
42.5 µs42 µs
test_positional_tuple
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
21.7 µs21.5 µs
test_uuid_from_string_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
36.3 µs35.9 µs
test_filter
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
45.8 µs45.3 µs
test_model_exclude_unset_false
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
31.8 µs31.5 µs
test_dataclass_serialization_json
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
27.5 µs27.2 µs
test_isinstance_string_strict_false
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
15.2 µs15.1 µs
test_chain_two_functions
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
30.5 µs30.2 µs
test_to_string_direct
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
21.8 µs21.6 µs
test_model_exclude_unset_true
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
38.3 µs37.9 µs
test_core_string_strict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
13.6 µs13.5 µs

Commits

Click on a commit to change the comparison range
Base
main
47aff70
-0.05%
Trimming str before parsing to int and float
6d65143
2 years ago
© 2026 CodSpeed Technology
Home Terms Privacy Docs