Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Reuse `re.Pattern` object in regex patterns

#1318Merged
Comparing
regex-fix
(
4555a1a
) with
main
(
8afaa45
)
CodSpeed Performance Gauge
0%
Untouched
155

Benchmarks

155 total
test_dataclass_to_json
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+3%
39.9 µs38.6 µs
test_uuid_from_uuid_pyd
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+2%
14.8 µs14.4 µs
test_int_error
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
41.1 µs40.4 µs
test_date_format_function_no_info
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+2%
51.1 µs50.3 µs
test_isinstance_string_lax_true
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
13.9 µs13.7 µs
test_isinstance_string_strict_true
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14 µs13.8 µs
test_core_raw
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
13.9 µs13.7 µs
test_validate_literal[json-many_small_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
15.8 µs15.6 µs
test_filter
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
43.1 µs42.5 µs
test_decimal_from_string_limit
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDecimal
CodSpeed Performance Gauge
+1%
18.1 µs17.8 µs
test_core_raw
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+1%
14.2 µs14.1 µs
test_decimal_from_string_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDecimal
CodSpeed Performance Gauge
+1%
24 µs23.7 µs
test_core_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+1%
19.8 µs19.5 µs
test_isinstance_string_strict_false
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
15.3 µs15.1 µs
test_date_format_function
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
52.2 µs51.7 µs
test_isinstance_string_lax_false
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
15.6 µs15.4 µs
test_strict_union_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUnion
CodSpeed Performance Gauge
+1%
16.5 µs16.3 µs
test_core_future_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+1%
20.1 µs19.9 µs
test_core_future
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+1%
17.9 µs17.7 µs
test_uuid
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
33.8 µs33.5 µs
test_generator_python
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
27.3 µs27.1 µs
test_date_format
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
51.4 µs50.9 µs
test_core_python
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
30.3 µs30.1 µs
test_uuid_from_uuid_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
13.9 µs13.8 µs
test_datetime
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
28 µs27.8 µs

Commits

Click on a commit to change the comparison range
Base
main
8afaa45
-0.16%
initial work for regex fix
43d4dbb
2 years ago
by sydney-runkle
+0.22%
reorganizing things to use explicit pattern strings
8c15026
2 years ago
by sydney-runkle
-0.14%
use python-re whenever pattern is compiled
9903a32
2 years ago
by sydney-runkle
+0.39%
str not string?
c26307d
2 years ago
by sydney-runkle
-0.24%
use any in the meantime
3aa3985
2 years ago
by sydney-runkle
-0.08%
consistent comments
2a64e16
2 years ago
by sydney-runkle
+0.38%
fix for 3.12.4+
9bb53d8
2 years ago
by sydney-runkle
-0.61%
Merge branch 'main' into regex-fix
6bddb4b
2 years ago
by sydney-runkle
+0.37%
revert eval fix
b9dad9d
2 years ago
by sydney-runkle
+0.3%
support for 3.12.4
6ee8b04
2 years ago
by sydney-runkle
-0.27%
get tests passing
31cac08
2 years ago
by sydney-runkle
0%
fix things again for eval_forward_ref
2ad5724
2 years ago
by sydney-runkle
-0.11%
check compiled pattern uses flags in test
4555a1a
2 years ago
by sydney-runkle
© 2026 CodSpeed Technology
Home Terms Privacy Docs