Файли
openidea/crates
farmer_timmm fe04de3862 fix(syntax): share the memoized outline/folding instead of cloning it (#8309)
SyntaxCache::memoized stored each result behind an Arc but deep-cloned the Vec out of it on every cache hit, which for the outline (a tree of Strings) cost milliseconds on a 2 MB file. memoized now returns the Arc, and outline() and folding() return Arc<Vec<_>>; the two IPC commands that own and extend their result take it out once with Arc::unwrap_or_clone. Results are unchanged; outline_cached_hit went from 4.68 ms to 80 ns and folding_cached_hit from 21.7 µs to 72 ns in the criterion benches.

Co-authored-by: Ttimmahlax <[email protected]>
2026-12-06 07:52:52 +08:00
..