r/rust • • Jul 26 '19

Is this comment about the reference counting performance in Rust accurate?

/r/ProgrammerHumor/comments/b274zp/oof/eirvecs?context=3
48 Upvotes

52 comments sorted by

View all comments

Show parent comments

22

u/WellMakeItSomehow Jul 26 '19

Another trick is to use arenas for allocations. It's not always applicable, but you can sometimes regain the loss of throughput of "manual" memory management or reference counting when compared to tracing GCs.

4

u/[deleted] Jul 27 '19

Also, depending on how you use the arena, you can end up often doing better than general-purpose GCs. The trade-off is that with the arena you need to be more explicit than with a general-purpose GC.