Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: general programming question

Author: Oliver Roese

Date: 13:10:40 06/20/01

Go up one level in this thread


On June 20, 2001 at 14:56:49, Gunnar Andersson wrote:

>On June 20, 2001 at 06:16:50, JW de Kort wrote:
>
>>Hi
>>
>>I'am about to go through my whole program to make the code more efficient. Are
>>their books or internet sites about this topic? In other words were can i find
>>material on efficient programming. (I use the language C).
>
>Don't.  Go through the parts of your program that are bottlenecks---use a
>profiler to find these, e.g. gprof works with GCC.  You may also want to use a
>cache profiler; I've used CacheProf and found it sufficient for my (very basic)
>needs.
>
>Some useful links:
>
>  www.ontek.com/mikey/optimization.html (very basic)
>
>  www.azillionmonkeys.com/qed/programming.html (more advanced, some asm)
>
>  www.pcguide.com/ref/mbsys/cache/func.htm (caches)
>
>  www.google.com (search for info about caches and optimization)
>
>If you use bitboards, have a look at e.g. Crafty's source code.
>
>Look at assembly code output from your compiler (gcc -S).  Even if you don't

There is still a better method. Compile with debug information, and then do
$ objdump -S <objectfile>
The assembler instructions will be shown intermixed with your sourcecode.

Oliver

>want to write directly in assembly language it is still possible to learn a lot
>from looking at the hotspots.  Both Intel and AMD have good documentation about
>their processors (Altavista: "+Athlon +optimization" should do the trick), this
>is useful also for C programmers.
>
>My $0.0002,
>
>/ Gunnar



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.