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

[ty] Optimize and simplify `UnionElement::try_reduce`

#22339Merged
Comparing
alex/optimize-try-reduce
(
067a6ba
) with
main
(
e63cf97
)
CodSpeed Performance Gauge
0%
Untouched
23
Skipped
30

Benchmarks

53 total
pydantic
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+1%
10.6 s10.5 s
static_frame
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
21.7 s21.7 s
sympy
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
52.2 s52.2 s
colour_science
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
93.8 s94 s
pandas
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
64.1 s64.3 s
freqtrade
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
8.1 s8.1 s
tanjun
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
2.5 s2.6 s
ty_micro[many_enum_members_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members_2
CodSpeed Performance Gauge
0%
350.6 ms351.9 ms
ty_check_file[incremental]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_incremental
CodSpeed Performance Gauge
0%
6.1 ms6.2 ms
hydra-zen
crates/ruff_benchmark/benches/ty.rs::project::hydra::project
CodSpeed Performance Gauge
0%
1.2 s1.2 s
ty_micro[many_enum_members]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members
CodSpeed Performance Gauge
0%
122.4 ms122.9 ms
ty_check_file[cold]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_cold
CodSpeed Performance Gauge
0%
131.6 ms132.2 ms
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
-1%
436.8 ms439.1 ms
ty_micro[many_string_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_string_assignments
CodSpeed Performance Gauge
-1%
80.3 ms80.7 ms
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
-1%
1.2 s1.2 s
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_tuple_assignments
CodSpeed Performance Gauge
-1%
66.2 ms66.6 ms
ty_micro[complex_constrained_attributes_1]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_1
CodSpeed Performance Gauge
-1%
68.4 ms68.9 ms
ty_micro[complex_constrained_attributes_3]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_3
CodSpeed Performance Gauge
-1%
71.4 ms71.9 ms
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_tuple_implicit_instance_attributes
CodSpeed Performance Gauge
-1%
68.2 ms68.7 ms
ty_micro[complex_constrained_attributes_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_2
CodSpeed Performance Gauge
-1%
68.1 ms68.6 ms
DateType
crates/ruff_benchmark/benches/ty.rs::project::datetype::project
CodSpeed Performance Gauge
-1%
236.5 ms239 ms
altair
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-1%
5.2 s5.2 s
multithreaded
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-1%
1.4 s1.4 s
formatter[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter
Skipped
1.9 ms*
linter/default-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
Skipped
1 ms*

Commits

Click on a commit to change the comparison range
Base
main
e63cf97
-0.16%
[ty] Optimize `UnionElement::try_reduce`
6e97c3b
1 month ago
by AlexWaygood
-0.1%
simplify more
e664466
1 month ago
by AlexWaygood
-0.02%
try something else
b3163e3
1 month ago
by AlexWaygood
+0.09%
more laziness
da38352
1 month ago
by AlexWaygood
-0.24%
Micha's suggestion
067a6ba
1 month ago
by AlexWaygood
© 2026 CodSpeed Technology
Home Terms Privacy Docs