You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently, our tagged length stores on the least significant bit the marker for whether the allocation is on the heap or on the stack
changing it to the MSB will allow to make incrementing/decrementing by any value simple additions/subtractions which would improve performance
however, throughout the codebase we don't make use of direct addition/subtraction to TaggedLen, and instead we rely on replacing the instance and keeping a counter on the fly, which is not nice and has unnecessary overhead. #570 aims to change this
It is a dead-end and waste of time, I couldn't make it work, I achieved 4-5% improvement in push benchmarks and up to 20-40% regression in some other benchmarks. I tried really hard but it seems LLVM can't generate optimized code for it.
I ended up with more asm instructions and general regression in all benchmarks combined.
Activity
TaggedLen/set_len/capacity... model #451fereidani commentedon Sep 3, 2026
It is a dead-end and waste of time, I couldn't make it work, I achieved 4-5% improvement in push benchmarks and up to 20-40% regression in some other benchmarks. I tried really hard but it seems LLVM can't generate optimized code for it.
I ended up with more asm instructions and general regression in all benchmarks combined.
alejandro-vaz commentedon Sep 3, 2026
yeah that's exactly the conclusion I came to, but maybe we are doing something wrong
fereidani commentedon Sep 3, 2026
Maybe, But I believe I did the best I could, I won't put any more time on it. Maybe someone else wants to give it another shot.
alejandro-vaz commentedon Sep 3, 2026
I don't think it's worth it, we both tried and failed, that's enough evidence