about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorChayim Refael Friedman <chayimfr@gmail.com>2024-10-18 10:16:08 +0300
committerChayim Refael Friedman <chayimfr@gmail.com>2025-01-02 19:21:46 +0200
commitacb3490b09caa975943d11ecd2c33a5c8e3f35d2 (patch)
treedf915084c2ad726aec21cd89b833e9c43fd2a984 /compiler/rustc_codegen_llvm/src
parent65bf7f790b7427fee291f1aa0e69e5c7c2d5ecd2 (diff)
downloadrust-acb3490b09caa975943d11ecd2c33a5c8e3f35d2.tar.gz
rust-acb3490b09caa975943d11ecd2c33a5c8e3f35d2.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions