Warning
This post was published 37 days ago. The information described in this article may have changed.
Recently, I refactored my codebase to solve a memory issue. I saw that all the Vec
s are taking up too much memory, so I decided to switch to lazy iterators instead. However, I encountered another surprise: The performance of my program was worse than the Vec
version.
I then ran cargo flamegraph
. I saw that in the iterator bridge version, there are multiple wide white holes (probably because only 1 thread is running there). The Vec
version still has holes but they are narrower.
Is there a way to solve memory issue without compromising speed?
1 post - 1 participant
🏷️ rust_feed