Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Why is assembly more effecient than C?

Author: James Robertson

Date: 14:48:32 09/27/98

Go up one level in this thread


On September 27, 1998 at 17:39:30, John Coffey wrote:

>On September 26, 1998 at 18:00:26, James Robertson wrote:
>
>
>>The compiler generates very efficient code; but there are a lot of things you
>>can do in assembly that aren't avaliable in C++. Also, in assembly you think
>>about programming differently; I saw things I could do to improve performance I
>>never thought about in the C++ enviroment.
>
>
>Have others found assembly to be faster than straight C?  I still think
>that memory accesses might be the bottle-neck - i.e. so it is hard for me
>to see assembly as a big improvement over C.
>
>John Coffey

As far a I know, well-optimized C or C++ is as good as assembly, with a few
exceptions. Looking at the sources to Arasan, GLChess, my program, etc. the only
function anyone ever seems to put into assembly is the bitboard function that
reads a bitboard and turns "1" bits into moves; in this case the assembly is
considerably faster. Maybe there are ways to do it in C that no ever thought of
though. :)
I'll have to take a look at Crafty; there are probably some eye-opening tricks
there.

James



This page took 0.02 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

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