Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: speed question about C programs

Author: Vincent Diepeveen

Date: 05:59:51 11/27/99

Go up one level in this thread


On November 27, 1999 at 04:16:53, blass uri wrote:

>Does someone know about a book about the fastest C program to do simple tasks?
>(for example to find if a number is a prime)

>I think that knowing this information can help to think about ideas how to do
>chess programs faster.

Let's please distinguish two things
  - used algorithm
  - used implementation

You can make a very good optimized program A to generate primes,
but a silly implemented other program B might generate at the same
hardware a lot faster primes using a better algorithm.

In general people then say that program A sucks and that a program B is
wonderful... ...yet from programming viewpoint this is rather hard to do.

>I understand that +- operations are faster than */ operations but I do not know
>how much faster and if it is dependent on the computer.

That depends upon architecture.
Multiply is in general not slower than incrementing with a register.
I'm using a lot of multiples in my DIEP's eval.

At the P5 it sure is very slow. At the PRO/PII/PIII/Xeon it isn't.
Don't know about the K7, but i bet it's not slower there either, as
DIEP runs 15.5% faster on a K7 than on a PIII at the same Mhz.

>Where can I get information like this information?

www.intel.com

Go to the technical references of the CPUs.
K7 is harder.

>I can find it by doing a simple program but I prefer not to check everything
>about speed by testing because I may have many question like this question.
>Uri

Rather hard to find it by doing a simple program, measuring things
accurately is also an art in itselve.

What is however slowing down programs most is not the clocks needed to
do an integer multiplication. The real problem are branches. At the
Merced this should all be solved, so i wonder why the first vague reports
about the merced don't say it to be a lot faster than the 21264 cpu.










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.