Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Use of objects and associated performance hit?

Author: Bruce Moreland

Date: 23:43:00 12/30/99

Go up one level in this thread


On December 30, 1999 at 22:21:24, Dann Corbit wrote:

>On December 30, 1999 at 21:55:26, Tom Kerrigan wrote:
>
>>On December 30, 1999 at 21:29:07, Dann Corbit wrote:
>>>>1. When I access the chess board class from the engine class, will there be a
>>>>performance hit?
>>>As close to zero as is humanly imaginable unless you do some exotic things like
>>>RTTI.  SEH takes a small toll also.  Templates often give a performance BOOST.
>>
>>I'm not familiar with either of these acronyms. I don't intend to use
>>templates... I'm just going to have two classes, one derived from the other.
>
>RTTI is Run Time Type Interpretation (or something like that).  It means that
>you figure out what kind of a thing something is on the fly.  It can be used to
>write extremely generic stuff, but there is an obvious performance hit.  You
>probably don't need to worry about it.  I almost never use it.

If he even thinks about doing this in a chess engine he should stop programming
and become a tax lawyer or a politician or a drug dealer or something.

>SEH is Structured Exception Handling.  It means you are using the
>try { //stuff that I really want to do...
>}
>catch (exception type 1) // maybe memory allocation failure
>{
>// handle exception
>}
>catch (exception type 2) // maybe floating point error or whatever...
>...
>catch (...) // Some other exception I did not imagine...
>{
>// handle exception
>}
>
>Which is wonderfully useful, but there is a small performance penalty incurred.

In his engine he probably wouldn't want to do this but it might not matter.  I
don't know what the overhead is.

bruce




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.