Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Do have the Crafty the Assembler written core?

Author: Ricardo Gibert

Date: 02:35:32 11/02/99

Go up one level in this thread


On November 01, 1999 at 22:08:44, leonid wrote:

>On November 01, 1999 at 22:02:50, Peter Kappler wrote:
>
>>On November 01, 1999 at 21:08:52, leonid wrote:
>>
>>>On November 01, 1999 at 19:59:43, Peter Kappler wrote:
>>>
>>>>On November 01, 1999 at 19:50:12, leonid wrote:
>>>>
>>>>>
>>>>>Hi!
>>>>>I have the Crafty game in my Hiarcs 7.32 package. When I plyed with Crafty I was
>>>>>impressed and puzzled. Impressed with the game that I found quick and good but
>>>>>doubtful about the central part of the game. In what language it was really
>>>>>written? Core part in Assembler, or 100% on C?
>>>>>
>>>>>Just can't retain me to not mention what really puzzled me in the game. It was
>>>>>one idea that never went away. Why to write so good game in so slow language? To
>>>>>use the C in this case is like to do the premeditated suicide. Like willingly
>>>>>leaving your first place to somebody else. But maybe I rush to the conclusion.
>>>>>
>>>>>Leonid.
>>>>
>>>>
>>>>Where did you get the idea that C is a "slow language"?
>>>>
>>>>Well-written C and a good compiler will produce very fast code.
>>>>
>>>>--Peter
>>>
>>>In despite of everything that could be said about the good compiler, and so
>>>like, Assembler is the speediest one possible. If Crafty, that is already more
>>>that good, could have just one version written in Assembler (if its core part
>>>not done already on Assembler) it could be speeded somewhere between 3 and 8
>>>times. This way game will start seeing extra ply. More that enough to put it
>>>from already good position to the best one. I can see only the portability the
>>>reason why game was done on C.
>>>
>>>Leonid.
>>
>>
>>How are you getting to this 3-8x estimate?  Sounds extremely optimistic.
>>
>>--Peter
>
>I remember that one small program I wrote in Assembler and later in Pascal.
>Pascal version was around 10 times bigger and as much slow.
>
>Leonid.

Stating that it is possible to get a 10x speed up in assembler is quite true.
Stating that C is not much slower also contains a lot of truth. Writing in a
high level language gives you more time to make algorithmic improvements to your
code that can match the assembly language tweeks you make to the original
algorithm. In assembler, you spend a lot more time writing and debugging. Time
that is better spend spent improving the algorithm. You learn more from the
algorithmic improvements. The assembly code you write is easily obsoleted by the
next generation of CPUs. This makes algorithmic improvements far more valuable &
durable. This is very much like the tortoise versus the hare parable. The
tortoise wins. If you use assembly, use it on a small percentage of your code,
where the payoff is greatest.



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.