astral-sh
ruff
BlogDocsChangelog

[ty] Improve `UnionBuilder` performance by changing `Type::is_subtype_of` calls to `Type::is_redundant_with`

#22337Merged
Comparing
alex/more-redundancy
(
f3b9422
) with
main
(
c02d164
)
CodSpeed Performance Gauge
+17%
Improvements
2
Untouched
21
Skipped
30

Benchmarks

Skipped (30)

formatter[large/dataset.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter
Skipped
9.4 ms*
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*
linter/default-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
Skipped
208.7 µs*
formatter[numpy/globals.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter
Skipped
247.4 µs*
parser[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
Skipped
949.6 µs*
formatter[pydantic/types.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter
Skipped
3.6 ms*
parser[numpy/globals.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
Skipped
109 µs*
linter/default-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
Skipped
2.2 ms*
lexer[large/dataset.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
Skipped
1.2 ms*
parser[large/dataset.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
Skipped
5.2 ms*
linter/all-with-preview-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
Skipped
831.6 µs*
linter/default-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
Skipped
404.2 µs*
linter/all-with-preview-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
Skipped
2.2 ms*
lexer[unicode/pypinyin.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
Skipped
79.2 µs*
linter/all-with-preview-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
Skipped
5.2 ms*
linter/all-with-preview-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
Skipped
22.4 ms*
linter/all-with-preview-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
Skipped
10.2 ms*
linter/all-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
Skipped
727.6 µs*
lexer[pydantic/types.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
Skipped
510.3 µs*
parser[pydantic/types.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
Skipped
2 ms*
formatter[unicode/pypinyin.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter
Skipped
688.2 µs*
lexer[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
Skipped
228.1 µs*
parser[unicode/pypinyin.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
Skipped
329.1 µs*
linter/all-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
Skipped
4.3 ms*
lexer[numpy/globals.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
Skipped
30.3 µs*
linter/all-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
Skipped
2 ms*
linter/all-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
Skipped
18.4 ms*
linter/all-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
Skipped
8.5 ms*
linter/default-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
Skipped
4.2 ms*

Improved

multithreaded
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+17%
1.3 s1.1 s
altair
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+8%
4.9 s4.6 s

Passed

ty_micro[many_string_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_string_assignments
CodSpeed Performance Gauge
+2%
80.2 ms78.6 ms
pydantic
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+1%
10.3 s10.1 s
sympy
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+1%
51.4 s51 s
hydra-zen
crates/ruff_benchmark/benches/ty.rs::project::hydra::project
CodSpeed Performance Gauge
+1%
1.2 s1.2 s
ty_micro[complex_constrained_attributes_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_2
CodSpeed Performance Gauge
0%
68.1 ms67.9 ms
ty_micro[complex_constrained_attributes_1]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_1
CodSpeed Performance Gauge
0%
68.3 ms68.2 ms
ty_micro[complex_constrained_attributes_3]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_3
CodSpeed Performance Gauge
0%
71.2 ms71.1 ms
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
0%
431.9 ms431.7 ms
DateType
crates/ruff_benchmark/benches/ty.rs::project::datetype::project
CodSpeed Performance Gauge
0%
234.2 ms234.1 ms
ty_check_file[cold]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_cold
CodSpeed Performance Gauge
0%
131.1 ms131 ms
tanjun
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
2.5 s2.5 s
freqtrade
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
7.8 s7.8 s
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_tuple_assignments
CodSpeed Performance Gauge
0%
66 ms66 ms
ty_micro[many_enum_members_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members_2
CodSpeed Performance Gauge
0%
341.4 ms341.5 ms
colour_science
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
87.5 s87.6 s
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
0%
1.2 s1.2 s
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_tuple_implicit_instance_attributes
CodSpeed Performance Gauge
0%
68.1 ms68.1 ms
pandas
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
62.8 s63 s
static_frame
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
21.1 s21.2 s
ty_check_file[incremental]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_incremental
CodSpeed Performance Gauge
0%
6.1 ms6.2 ms
ty_micro[many_enum_members]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members
CodSpeed Performance Gauge
-1%
121.5 ms123.2 ms

Commits

Click on a commit to change the comparison range
Base
main
c02d164
-9.98%
[ty] Improve `UnionBuilder` performance
d9f7d7a
8 days ago
by AlexWaygood
+31.01%
revert one change...
0df22e7
5 days ago
by AlexWaygood
-3.71%
update doc comment
f3b9422
3 days ago
by carljm
© 2026 CodSpeed Technology
Home Terms Privacy Docs