Computer Chess Club Archives




Subject: Re: C and C++ --- NPS

Author: David Rasmussen

Date: 03:50:41 12/26/02

Go up one level in this thread

On December 25, 2002 at 17:27:55, Peter Fendrich wrote:

>>C++ used as a better C isn't slower at all.
>>C++ used to make a better design won't hurt NPS if you do it right.
>>C++ using templates (maybe expression templates for evaluation etc.) can easily
>>be faster than C.
>What's so good with templates, regarding performance?

That it is a compile time technique, which means no runtime overhead, and that
you can make a clever design to eliminate temporaries etc. For example, read
about the concept of expression templates used in many mathematical libraries.
In general, read about numerics in C++ and you will find that many clever
techniques exists which rivals or exceeds the performance of Fortran, often by
the use of templates. And there is the general concept of compile time
programming/generic programming in which templates are also important. All of
these techniques can be used in several parts of a traditional chess program,
evaluation etc.


This page took 0.03 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.