rust-analyzer/crates/syntax-bridge/src
Chayim Refael Friedman ceba289f80 Store token trees in contiguous Vec instead of as a tree
I expected this to be faster (due to less allocations and better cache locality), but benchmarked it is not (neither it is slower). Memory usage, however, drops by ~50mb (of `analysis-stats .`). I guess tt construction is just not hot.

This also simplifies using even less memory for token trees by compressing equal span, which I plan to do right after.

Some workflows are more easily expressed with a flat tt, while some are better expressed with a tree. With the right helpers, though (which was mostly a matter of trial and error), even the worst workflows become very easy indeed.
2025-01-02 19:21:46 +02:00
..
lib.rs Store token trees in contiguous Vec instead of as a tree 2025-01-02 19:21:46 +02:00
prettify_macro_expansion.rs Get rid of $crate in expansions shown to the user 2024-09-18 18:30:59 +03:00
tests.rs Store token trees in contiguous Vec instead of as a tree 2025-01-02 19:21:46 +02:00
to_parser_input.rs Store token trees in contiguous Vec instead of as a tree 2025-01-02 19:21:46 +02:00