News for hackers. Stuff that matters.
Re:Popular Myths about C++, Part 3 by btmorex on Tuesday December 23, 2014 @01:02AM (#8786981)
As long as std::sort can fit in the instruction cache, who cares? (outside the embedded world obviously) It will always be faster unless you're getting regular instruction cache misses.
Re:Popular Myths about C++, Part 3 by makomk on Tuesday December 23, 2014 @05:45AM (#8787610)
Even if each instance of std::sort fits in the instruction cache, it's helping to push some other code elsewhere in the program out of the instruction cache, slowing that code down in the process.
Re:Popular Myths about C++, Part 3 by humanrebar on Tuesday December 23, 2014 @10:33AM (#8788499)
If std::sort pushes something out of icache, it's to make room for inlining swaps and compares. I'm skeptical that the other things bumped from icache should be kept hotter.
Re:Popular Myths about C++, Part 3 by comex on Tuesday December 23, 2014 @01:29PM (#8789407)
In addition to the "unless you sort 10 elements" factor, as stated in a sibling comment -

LLVM + libclang together are already 46MB of code, and they're libraries designed to be statically linked. Sure, they aren't going to fill your drive, but they will take a comparative while to load from disk (especially as part of another application - doesn't matter much on the command line), and it's that much harder to justify including them in an otherwise small downloaded package.

Re:Popular Myths about C++, Part 3 by ant6n on Tuesday December 23, 2014 @11:19AM (#8788716)
Unless you sort 10 elements
Re:Popular Myths about C++, Part 3 by rasz_pl on Tuesday December 23, 2014 @10:02AM (#8788347)
Yes, and if it doesnt just wait for better CPU, right? You work for microsoft?
Re:Popular Myths about C++, Part 3 by humanrebar on Tuesday December 23, 2014 @10:32AM (#8788491)
If it doesn't, use qsort. C++ lets you do that.