2 ms·
The index-based approach can be refined to guarantee that the index is in the heap and avoid the bounds check, or even updated to directly use raw pointers if y
by Jweb_Guru 7y ago
The index-based approach can be refined to guarantee that the index is in the heap and avoid the bounds check, or even updated to directly use raw pointers if you use an arena. The main disadvantage compared to garbage collection is that it's not moving, but for many workloads the whole graph will die before a more mature GC would do a major collection anyway--all the movement is in the young generation. So, the main advantage of GC at that point is mostly about memory consumption since most objects die young (and you don't have to trace them if they do). Rust could get back almost all performance against state of the art GCs even for graph workloads by just using an arena for the old generations and focusing on young generation optimization.