Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Problem with Object Oriented Design (programming issue)

Author: Vincent Diepeveen

Date: 05:39:49 09/22/03

Go up one level in this thread


On September 21, 2003 at 21:15:06, Robert Hyatt wrote:

>On September 21, 2003 at 20:07:11, Vincent Diepeveen wrote:
>
>>On September 20, 2003 at 15:58:03, Dave Gomboc wrote:
>>
>>>On September 15, 2003 at 19:28:39, Mathieu Pagé wrote:
>>>
>>>>In fact I have not yet implementing dynamic allocation.
>>>>
>>>>I'm pretty sure it's about too much constructor executing.
>>>>
>>>>I'd like to know if someone had ever experiments which overhead (%) should I
>>>>expect when porting non-OO chess engine to OO ?
>>>>
>>>>Thanks for your help, i'will give a try to your idea when implementing dynamic
>>>>allocation.
>>>>
>>>>Mathieu Pagé
>>>
>>>I'd expect zero overhead.
>>
>>then he's not using real OO features.
>>
>>As soon as you start using advanced stuff from object oriented programming, then
>>overhead is *huge*.
>>
>>Let's assume for example a neat OO program that's allocating and deallocating
>>objects of course. That's real neat OO programming.
>>
>>What junior team and others do in c++ is by no means what i call the real OO
>>features.
>>
>>The real OO features are dead slow for chess :)
>>
>>>Dave
>
>
>Not necessarily..  A chess board is a good example of an object.  There is
>no need to create a bunch of them, one is enough.  I've personally seen more
>than one _really_ elegant OO (C++) chess program that was just as fast as
>mine (it was a bitboard program also).

In fact i wrote several c++ programs a bunch of years ago, using all kind of
cool c++ features (from which some i probably am forgotten again) and the code
was *dead* slow. Of course the code wasn't meant for speed.

I have not seen neat c++ code that's faster than C, using special c++ features.

If you use classical neat c++ then a chessprogram is just busy allocating and
destroying objects, which is *real* slow.

As soon as you start using tricks to avoid all that, then all you end up is a C
program with extension cpp.

Best regards,
Vincent




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.