Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: One (silly) question about "C"

Author: Dann Corbit

Date: 18:00:17 02/05/02

Go up one level in this thread


On February 05, 2002 at 20:37:45, Dieter Buerssner wrote:
[snip]
>Also, as I said before, typically in more complex applications, the compiler
>unrolling is applied too often. And I also did not take the time, to use try
>other unrolling factors than 8, something which I might have done for an inner
>loop in an application that runs for a very long time. This also can naturally
>be very CPU/cache size dependant.
>
>Anyway, I agree with you, that normally it is not worthwhile to try such tricks.
>
>Regards,
>Dieter
>
>PS. Perhaps my test is also flawed. I just wrote it up in few minutes, and did
>not check if (for example) the usage of the double sum in the main() make a
>difference, nor did I care to design this carefully.

I will admit that I have been known to try cheesy tricks from time to time
(actually, quite often).  If a profile shows some key area to be a hot spot,
then that is the place I will attack.  Typically, it is a nested loop where the
trouble is found.  Hence, this very sort of thing can come in quite handy.

Usually, I will think about the algorithm first.  Then I will try one or two
changes if I can think of any.  If memory management is involved, that is often
a good place to get a radical speedup (even 100x is not unheard of).

Mike Lee gives a nice summary of microptimization techniques in "C Unleashed"
Chapter 3.

In general, I will simply write to communicate (to myself!) the meaning of the
fundamental algorithm.  But when some key burst of speed is needed somewhere, I
am certainly not above trying dirty little hacks.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.