3 ms·
>restore those stalls and inefficiencies as the way things are when you don't use those strange data structures, right No, a stall is only a thing because bran
by alien_at_work 9y ago
>restore those stalls and inefficiencies as the way things are when you don't use those strange data structures, right
No, a stall is only a thing because branch prediction exists. Get rid of it and I can go back to not caring about the deep underlying architecture of the hardware I may potentially be running on. And not doing branch prediction isn't inefficient... that's a bizare statement. Branch prediction and speculative execution are themselves inefficiencies (i.e. spending power to do things that will turn out to not be needed fairly often).
>the naive implementation would be the best implementation
Not the naive implementation. A well thought out, developed implementation that is defeated by deep hardware details. The promise of high level languages was always to avoid having to know these sorts of details. In designing an algorithm I should be worried about things like how often I access data (e.g. can I cut down on how many accesses with some clever structure?) and the like. Now that's all trumped by deeply knowing the low level implementation.
- zzzcpan 9y agoNothing changes for high level languages. If they are high level enough they can still fix Spectre and abstract away deep hardware details.
- alien_at_work 9y agoThat's exactly my point: you cannot abstract away details of pipeline size. You must know this to get the best performance out of your structures and algorithms. There is no way for a compiler/optimizer to look at your container implementation and say "oh, this will potentially overflow the pipeline, let's split the data structure into multiple parts and change the code to handle this new access stategy"... that would be creating entirely new code (what would stepping through a debugger look like on such code?).