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

Reserve AST Vec's with correct capacity for common cases

#25451
Comparing
micha/parser-exact-initialization-only
(
e63ea0d
) with
micha/parser-shrink-more-collections
(
d8914fe
)
CodSpeed Performance Gauge
-13%
Improvement
1
Regression
27
Untouched
97

Benchmarks

125 total
ty_micro[pydantic_core_schema_dict]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_pydantic_core_schema_dict
CodSpeed Performance Gauge
-77%
95.2 ms422.5 ms
pydantic
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-53%
16.7 s35.3 s
ty_micro[pydantic_core_schema_dict]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_pydantic_core_schema_dict
CodSpeed Performance Gauge
-22%
14.8 MB19 MB
ty_micro[pandas_tdd]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_pandas_tdd
CodSpeed Performance Gauge
-7%
36.4 MB39.1 MB
ty_micro[complex_constrained_attributes_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_2
CodSpeed Performance Gauge
-7%
12.7 MB13.6 MB
ty_micro[complex_constrained_attributes_1]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_1
CodSpeed Performance Gauge
-7%
12.7 MB13.6 MB
ty_micro[gradual_vararg_call]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_gradual_vararg_call
CodSpeed Performance Gauge
-6%
12.3 MB13.1 MB
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_tuple_implicit_instance_attributes
CodSpeed Performance Gauge
-6%
13.2 MB14.1 MB
ty_micro[very_large_tuple]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_very_large_tuple
CodSpeed Performance Gauge
-6%
12.5 MB13.3 MB
ty_micro[many_enum_members]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members
CodSpeed Performance Gauge
-6%
15 MB15.9 MB
ty_micro[large_isinstance_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_large_isinstance_narrowing
CodSpeed Performance Gauge
-6%
13.7 MB14.6 MB
ty_micro[many_enum_members_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members_2
CodSpeed Performance Gauge
-6%
13.8 MB14.7 MB
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_tuple_assignments
CodSpeed Performance Gauge
-6%
12.2 MB13 MB
ty_micro[complex_constrained_attributes_3]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_3
CodSpeed Performance Gauge
-6%
14.2 MB15.1 MB
DateType
crates/ruff_benchmark/benches/ty.rs::project::datetype::project
CodSpeed Performance Gauge
-6%
21.6 MB23 MB
ty_micro[many_string_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_string_assignments
CodSpeed Performance Gauge
-6%
13.8 MB14.7 MB
ty_check_file[cold]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_cold
CodSpeed Performance Gauge
-6%
18.7 MB19.9 MB
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
-6%
37.8 MB40.1 MB
ty_micro[many_protocol_members_mismatch]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_protocol_members_mismatch
CodSpeed Performance Gauge
-6%
18.3 MB19.4 MB
ty_micro[literal_equality_fallthrough_guarded_any]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_literal_equality_fallthrough_guarded_any
CodSpeed Performance Gauge
-5%
13.6 MB14.4 MB
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
-5%
72.4 MB76.6 MB
hydra-zen
crates/ruff_benchmark/benches/ty.rs::project::hydra::project
CodSpeed Performance Gauge
-5%
62.6 MB66.1 MB
ty_micro[typevar_mapping_small_accumulations]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_typevar_mapping_small_accumulations
CodSpeed Performance Gauge
-5%
14 MB14.7 MB
ty_check_file[incremental]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_incremental
CodSpeed Performance Gauge
-5%
150 KB157.8 KB
ty_micro[literal_match_fallthrough_guarded_any]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_literal_match_fallthrough_guarded_any
CodSpeed Performance Gauge
-5%
15 MB15.8 MB

Commits

Click on a commit to change the comparison range
Base
micha/parser-shrink-more-collections
d8914fe
-12.8%
Reserve Vec's with capacity of 1 for nodes unlikely to contain more
e63ea0d
4 days ago
by MichaReiser
© 2026 CodSpeed Technology
Home Terms Privacy Docs