Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: copy cost

Author: Johan de Koning

Date: 18:23:58 08/25/03

Go up one level in this thread


On August 25, 2003 at 11:32:10, Robert Hyatt wrote:

[snip]
>>Since I was only interested in cache to cache speed, I simply inserted
>>/**/ dummy[d] = pos[d];
>>just before the usual copy/make that starts with
>>/**/ pos[d+1] = pos[d];
>>
>
>There is a danger in your test.  It is _possible_ that a good compiler
>will recognize that code as "useless" and toss it out silently.  I see this
>happening all the time with gcc and the Intel compiler I use under Linux.
>
>If you do something like a=b, and a is not global, and it is not used anywhere
>further down in the procedure, it will get eliminated.  If a is global, it has
>to do the copy of course as the compiler can't tell who might use that value
>in another procedure.

Yes, I know how to abuse the compiler. :-)
And I'm also aware of benchmarking rule #1: watch the code, not the source.

... Johan



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.