Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about when to use local varaibles

Author: Dave Gomboc

Date: 18:06:34 09/05/03

Go up one level in this thread


Common Misconceptions:

[snip]

>Globals are faster than locals
>Most modern C compilers will alias local variables to your CPUs register's or
>SRAM.  Furthermore, if all variables in a given scope are local, then an
>optimizing compiler, can forgo maintaining the variable outside the scope, and
>therefore has more simplification optimization opportunities than with globals.
>So, in fact, you should find the opposite  tends to be true more of the time.

[snip]

Dave



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.