Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Delphi version of TSCP

Author: Andrew Dados

Date: 12:49:00 12/19/00

Go up one level in this thread


On December 18, 2000 at 04:14:30, Steve Maughan wrote:

>You may be interested to know that Robert Lee has converted TSCP v 1.62 into
>Object Pascal.  You will find the code and some discussion at:
>
>http://www.optimalcode.com
>
>This came as a result of me asking, "is VC 6 faster than Delphi 5 for Chess" in
>a Delphi forum (my chess program is a Delphi app).  Robert Lee interest is in
>high performance Delphi code as opposed to computer chess but his results are
>encouraging to those, like myself, who have written Delphi chess apps.
>
>Regards,
>
>Steve Maughan

Hi,

I have my program written entirely in Delphi and I always wondered how faster
would same code translated to C run compiled with msvc.

Recently I ported enough of it to C to do some testing and it seems that with
right optimizations (like _fastcall convention) and lots of inlining msvc binary
can have about 30% speedup over Delphi (that on AMD k3 450, have to try that on
PIII). Delphi compiles much faster then msvc, but it lacks preprocessor, so
there is no way to inline things (which probably produces most speedup).

Since both Delphi and msvc are close in speed the big difference can happen when
you choose wrong (slow) data representation (or code implementation). E.g. my
simple material counting loop was faster in Delphi then in msvc no matter what
optimization, until I changed some basic data structures (so I can cast them to
int). So direct translation can be misleading.

One example are nested functions - faster in Delphi, then direct translation to
C, when you need to pass additional pointer to 'unnested' function. Another is
'with' pascal directive which becomes slower in msvc in some cases.

-Andrew-



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.