incr.comp.: Use a set implementation optimized for small item counts for deduplicating read-edges. by michaelwoerister · Pull Request #45577 · rust-lang/rust (original) (raw)
Thanks for kicking off the performance measurement, @kennytm!
Could you try and get some numbers on the performance improvement or the hit rate?
@julian-seward1 and I ran into this function as on of the hotter ones while profiling a incremental building of the regex crate. The compiler spends roughly 0.9% and 1.6% of cycles in the read_index()
function, depending on how much of the dependency graph can be marked as green. So that's the upper limit of the performance improvement here.
The main intended optimization here is to get rid of the heap allocation for small hash sets. It's a bit surprising that the effect on the overall instruction count is so small. I would have hoped for -0.5% instead of -0.1%.
There is even a +17.4% max-rss (memory use) in the regex-opt-0.1.80@020-incr-from... test case.
This must be some other effect. I don't see how this could introduce any noticeable increase in memory consumption.
Thanks for your comments, everyone! Maybe I'll tinker some more with this in my spare time. Closing for now.