News for hackers. Stuff that matters.
Re:Avoiding Instruction Cache Misses by gumby on Saturday June 22, 2019 @04:13PM (#20251498)
One of the criticisms of the C++ standardization efforts is how many of the improvements are quitearcane. But those arcane features aren't necessarily for user code but to make library code efficient. Implementations of the standard library are often almost unreadable because of all the weird corner cases and performance optimizations they have to transparently handle.

This can go a long way to improving user code...but of course it's no magic bullet.

Re:Avoiding Instruction Cache Misses by adrianN on Sunday June 23, 2019 @01:56AM (#20253522)
I really dislike this mindset in the C++ community. The people writing libraries are normal programmers too. They're not some kind of supermen on whom you can load infinite complexity. And it's not like the STL is this amazing piece of software that mere mortals can't beat. Quite the contrary, any sufficiently large piece of software tends to replace the STL at least in parts with their own implementation.
Re:Avoiding Instruction Cache Misses by danbolt on Sunday June 23, 2019 @05:31PM (#20258799)
Herb Stutter mentioned once that an advantage of the STL is that it gets you good general-purpose performance initially, but tries to stay out of your way if you want to replace it for something more specialized.

I think you’re right about a codebase replacing parts of STL as necessary. One I see frequently is `std::array` being wrapped with iterators to be essentially a stack-allocated vector.

Re:Avoiding Instruction Cache Misses by gumby on Sunday June 23, 2019 @11:23AM (#20256149)
I don't see that that in any way contrasts with what I wrote. The same is true of the C standard library.
Re:Avoiding Instruction Cache Misses by MaxBarraclough on Sunday June 23, 2019 @02:28PM (#20257659)
Do you have an example of what you're thinking of?
Re:Avoiding Instruction Cache Misses by cbetti on Saturday June 22, 2019 @08:46PM (#20252583)
Are you talking about STL interfaces or implementations?
Re:Avoiding Instruction Cache Misses by gumby on Saturday June 22, 2019 @10:12PM (#20252864)
STL in particular, but it's hardly the only case.