News for hackers. Stuff that matters.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by kaba0 on Friday June 03, 2022 @06:44AM (#31606613)
I don't see how is it bad for branch prediction. Like, if you use the same smallvec object in a loop and do not insert any elements to it (so that it doesn't allocate on the heap) the branch will always turn in the same direction making it easy and cheap to predict. And I would think that in most use-cases your smallvec object will either remain in one state, not changing in-between.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by nmca on Friday June 03, 2022 @07:09AM (#31606776)
+1, I would love to see a trace of smallvec killing performance due to branch prediction.