Re: C/C++ speed optimization bible/resources/pointers needed!
Luna Moon wrote:
"Hendrik van der Heijden" <hvdh@gmx.de> wrote in message
news:46a99140$0$31634$9b4e6d93@newsspool3.arcor-online.net...
galathaea schrieb:
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.
Hendrik vdH
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
speed further.
Any more pointers? Hopefully there are some books/articles/resource
somewhere on this planet talking about highly efficient C++ code and
complier, etc.
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.
Web: www.google.com
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.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask