Avatar for the astral-sh user
astral-sh
ruff
BlogDocsChangelog

[ty] Enable narrowing for unions of TypedDict

#25188
Comparing
charlie/td-required-keys
(
9a9d64b
) with
main
(
a7ab646
)
CodSpeed Performance Gauge
-7%
Regression
1
Untouched
56
Skipped
60

Benchmarks

117 total
pydantic
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-7%
7.8 s8.4 s
multithreaded
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+1%
1.1 s1.1 s
ty_micro[large_isinstance_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_large_isinstance_narrowing
CodSpeed Performance Gauge
+1%
151.8 ms150.7 ms
ty_micro[large_union_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_large_union_narrowing
CodSpeed Performance Gauge
+1%
530.6 ms527.6 ms
ty_micro[typevar_mapping_accumulation]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_typevar_mapping_large_accumulation
CodSpeed Performance Gauge
0%
323.4 ms321.8 ms
ty_micro[typevar_mapping_small_accumulations]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_typevar_mapping_small_accumulations
CodSpeed Performance Gauge
0%
181.6 ms180.7 ms
pandas
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
62.5 s62.2 s
ty_micro[many_enum_members_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members_2
CodSpeed Performance Gauge
0%
171 ms170.7 ms
ty_micro[typeis_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_typeis_narrowing
CodSpeed Performance Gauge
0%
195.8 ms195.5 ms
colour_science
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
42.3 s42.3 s
hydra-zen
crates/ruff_benchmark/benches/ty.rs::project::hydra::project
CodSpeed Performance Gauge
0%
1.1 s1.1 s
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
0%
1.2 s1.2 s
tanjun
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
3 s3 s
ty_check_file[cold]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_cold
CodSpeed Performance Gauge
0%
155.3 ms155.2 ms
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
0%
486 ms485.9 ms
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_tuple_implicit_instance_attributes
CodSpeed Performance Gauge
0%
72.7 ms72.7 ms
ty_micro[complex_constrained_attributes_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_2
CodSpeed Performance Gauge
0%
73.1 ms73.1 ms
ty_micro[many_protocol_members_mismatch]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_protocol_members_mismatch
CodSpeed Performance Gauge
0%
22 MB22 MB
ty_check_file[cold]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_cold
CodSpeed Performance Gauge
0%
22.7 MB22.7 MB
ty_micro[complex_constrained_attributes_3]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_3
CodSpeed Performance Gauge
0%
17.3 MB17.3 MB
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_tuple_assignments
CodSpeed Performance Gauge
0%
15.3 MB15.3 MB
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
0%
84.2 MB84.2 MB
ty_micro[typeis_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_typeis_narrowing
CodSpeed Performance Gauge
0%
23 MB23 MB
ty_micro[vararg_parameter_type_accumulation]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_vararg_parameter_type_accumulation
CodSpeed Performance Gauge
0%
14.6 MB14.6 MB
ty_micro[pandas_tdd]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_pandas_tdd
CodSpeed Performance Gauge
0%
46.6 MB46.6 MB

Commits

Click on a commit to change the comparison range
Base
main
a7ab646
-4.65%
Invert logic
b8e85df
11 hours ago
by charliermarsh
+0.15%
Gate on TypedDict
8802453
11 hours ago
by charliermarsh
-0.35%
Omit constraint
08145e0
11 hours ago
by charliermarsh
+0.25%
Remove it
356d7aa
11 hours ago
by charliermarsh
-2.81%
Use a separate protocol
9a9d64b
5 hours ago
by charliermarsh
© 2026 CodSpeed Technology
Home Terms Privacy Docs