Re: C/C++ speed optimization bible/resources/pointers needed!
Luna Moon wrote:
"Hendrik van der Heijden" <firstname.lastname@example.org> wrote in message
you have to run benchmarks and profile code execution paths
but just choosing the right compiler has increased code
speed 40% in tight loops for me in the past
I've seen a 500% boost just from adding a compiler option (-mfpmath).
With this option, gcc uses SSE1/2 units for floating point
calculations (SISD, not vector code) instead of traditional x87 code.
Great! This is exactly what I want... Thanks so much I will try it
out! Which complier?
'gcc', didn't you read the sentence?
We have done everything at the algorithm level,
That's what I'd heard many times when folks asked me to find if it
was possible to improve anything. Then I'd find they have been using
'std::set<SomeType*>' to collect things "already touched" in an array
when processing it out of sequence. Some things one can find in some
codebases are unbelievable.
now we just want to
make sure our data structure, caches, and code organization don't do
stupid things to slow down and we try various tricks to squeeze up
Any more pointers? Hopefully there are some books/articles/resource
somewhere on this planet talking about highly efficient C++ code and
Books: "Efficient C++" by Bulka & Mayhew, "High Performance Computing"
by Wadleigh & Crawford, "Effective" series by Meyers. I am not going
to suggest Knuth's "TACP", it may be too late. But when you have time
after stopping working on your current stuff, do give it a read, at
least leaf through the Contents section.
Tools: Intel VTune, AutomatedQA AQtime.
Don't expect to find the instruction manual on how to speed up *your*
code. Do expect to find recommendations and speculations based on
a whole lot of assumptions. Nobody knows your code better than you,
and no thought process can replace measuring. So, do the measuring
first, then do the thinking.
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask