Latest Results
perf(visualizer): fix O(n²) chars().nth scan and reduce allocations (#344)
`generate_line_utf16_tables` used `content.chars().nth(i + 1)` where `i`
is a byte offset from `char_indices()`. That treated `i` as a char
index, so each `\r\n` check walked the string from the start (O(n) per
check, O(n²) over the loop) and returned the wrong char whenever
preceding content contained multi-byte UTF-8. `\n` is always a single
ASCII byte, so peeking `content.as_bytes().get(i + 1)` is both O(1) and
correct.
Also replace `s.push_str(&format!(...))` in `get_text` with `writeln!`,
which writes directly into the output `String` instead of allocating an
intermediate one per token.
Add `#[inline]` on `Token::{get_dst_line, get_dst_col, get_src_line,
get_src_col, get_source_id, get_name_id}`. Release+LTO already inlines
these through `serialize_mappings`, but the annotation helps debug
builds and downstream crates that don't enable LTO.
No behavior change — visualizer insta snapshots are unchanged. perf(visualizer): fix O(n²) chars().nth scan and reduce allocations
`generate_line_utf16_tables` used `content.chars().nth(i + 1)` where `i`
is a byte offset from `char_indices()`. That treated `i` as a char
index, so each `\r\n` check walked the string from the start (O(n) per
check, O(n²) over the loop) and returned the wrong char whenever
preceding content contained multi-byte UTF-8. `\n` is always a single
ASCII byte, so peeking `content.as_bytes().get(i + 1)` is both O(1) and
correct.
Also replace `s.push_str(&format!(...))` in `get_text` with `writeln!`,
which writes directly into the output `String` instead of allocating an
intermediate one per token.
Add `#[inline]` on `Token::{get_dst_line, get_dst_col, get_src_line,
get_src_col, get_source_id, get_name_id}`. Release+LTO already inlines
these through `serialize_mappings`, but the annotation helps debug
builds and downstream crates that don't enable LTO.
No behavior change — visualizer insta snapshots are unchanged.perf/visualizer-and-token-accessors Latest Branches
+2%
+1%
release-plz-2026-05-25T05-39-38Z 0%
perf/visualizer-and-token-accessors © 2026 CodSpeed Technology