Computer Chess Club Archives


Search

Terms

Messages

Subject: Assembly in VC6.0 – an (bad) experience!

Author: Pham Minh Tri

Date: 21:18:44 03/14/01


Hi all,

In MS DOS environment, I have written some pieces of code in assembly to speed
up program and I could double speed by that way. However, when I moved my code
into Windows and VC6.0 compiler, that method of speedup did not work. I have
tried several times and measured that the program with some assembly pieces of
code could be slightly slower than one without them (pure C++, option
optimization: maximize speed). An annoying result, isn’t it? At end I gave up
with some conclusions as following:

1) My experience of writing and optimisation assembly is 16 bit one, not good
enough for 32 bit with many new instructions. However, I little doubt about this
conclusion because I designed all data structures suitable for 16 bit (I did not
use Bitboard structure), and many 16-bit instructions are not slower than 32 bit
(and some others may be quicker).

2) MS VC6.0 compiler may do the best for optimisation of speed. It means we
could do very little more only.

3) Many functions of chess, which we may convert into assembly code, are not
complicated, so that a good compiler as VC6.0 could make optimisation as good as
an expert. People could do better than program in more complicated and graphic
applications.

4) Because of all above, if I insist, I could get a speedup of 3-5% after a huge
effort. It is much more expensive than speedup by other way.

Just my thought and experience. Do you get better results or other experiences?
Pham



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.