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

[parser] Reset lexer state at notebook cell boundaries

#24163
Comparing
chinar-amrutkar:feat/notebook-cell-boundary-lexer
(
e8af46e
) with
main
(
a033779
)
CodSpeed Performance Gauge
-6%
Regression
5
Untouched
102

Benchmarks

107 total
lexer[pydantic/types.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
-6%
518.5 µs554.4 µs
lexer[large/dataset.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
-6%
1.2 ms1.3 ms
lexer[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
-6%
234.5 µs249.6 µs
lexer[unicode/pypinyin.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
-6%
80.8 µs85.8 µs
lexer[numpy/globals.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
-5%
30.9 µs32.6 µs
ty_micro[large_union_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_large_union_narrowing
CodSpeed Performance Gauge
+1%
502.8 ms498.4 ms
pydantic
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+1%
7.5 s7.4 s
ty_micro[large_isinstance_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_large_isinstance_narrowing
CodSpeed Performance Gauge
+1%
147.2 ms146.3 ms
colour_science
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
59 s58.9 s
tanjun
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
2.9 s2.9 s
linter/all-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
751.7 µs750.3 µs
linter/all-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
4.5 ms4.5 ms
linter/all-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
8.9 ms8.9 ms
linter/all-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
2 ms2 ms
linter/all-with-preview-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
2.3 ms2.3 ms
linter/all-with-preview-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
23.4 ms23.4 ms
linter/all-with-preview-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
10.5 ms10.5 ms
linter/all-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
19.5 ms19.5 ms
linter/all-with-preview-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
848.2 µs847.4 µs
linter/all-with-preview-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
5.3 ms5.3 ms
ty_micro[many_string_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_string_assignments
CodSpeed Performance Gauge
0%
16.8 MB16.8 MB
ty_micro[complex_constrained_attributes_3]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_3
CodSpeed Performance Gauge
0%
16.9 MB16.9 MB
ty_micro[pandas_tdd]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_pandas_tdd
CodSpeed Performance Gauge
0%
46.3 MB46.3 MB
ty_micro[typeis_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_typeis_narrowing
CodSpeed Performance Gauge
0%
21.8 MB21.8 MB
ty_micro[many_enum_members_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members_2
CodSpeed Performance Gauge
0%
17.8 MB17.8 MB

Commits

Click on a commit to change the comparison range
Base
main
a033779
-15.52%
[parser] Use cursor-driven cell boundary detection
c7fd95d
5 days ago
by chinar-amrutkar
-0.14%
perf: skip cell boundary check on hot path for non-notebook files
de675bb
4 days ago
by chinar-amrutkar
0%
fix: cargo fmt
24ee5b3
4 days ago
by chinar-amrutkar
+9.56%
fix: remove dead current_cell field from LexerCheckpoint
df3903a
4 days ago
by chinar-amrutkar
-0.02%
fix: remove stale clippy cast_possible_truncation expectation
f31f159
4 days ago
by chinar-amrutkar
+5.25%
chore: remove debug tests
70b3033
4 days ago
by chinar-amrutkar
-7.06%
fix: thread cell_offsets through Parser constructor
6ad5518
4 days ago
by chinar-amrutkar
+0.86%
perf: precompute cell_end_offset to avoid extra add per token
a99a5b0
4 days ago
by chinar-amrutkar
+0.7%
perf: restrict cell-boundary range fixup to EOF/Dedent tokens
fe10c10
4 days ago
by chinar-amrutkar
+6.15%
perf: mark consume_end and advance_to_next_cell as cold/inline(never)
82e85e1
4 days ago
by chinar-amrutkar
+0.03%
style: run cargo fmt
3b5a24a
3 days ago
by chinar-amrutkar
-6.33%
fix: filter trailing cell offset and skip dedent at root-level boundaries
423680a
3 days ago
by chinar-amrutkar
+5.92%
fix: revert has_cells logic to match original
8b2de99
3 days ago
by chinar-amrutkar
-5.87%
fix: remove range_from_consume_end from root-level cell boundary
dfc0f64
3 days ago
by chinar-amrutkar
0%
fix: move root-level check after flush to avoid hot-path overhead
82f5c23
3 days ago
by chinar-amrutkar
-0.02%
test: add parser tests for notebook cell boundary syntax errors
9e77738
4 hours ago
by chinar-amrutkar
+0.01%
fix: don't emit Dedent at cell boundaries with open indent stack
e8af46e
3 hours ago
by chinar-amrutkar
© 2026 CodSpeed Technology
Home Terms Privacy Docs