Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: OT: switch Statement Performance Consideration

Author: Robert Hyatt

Date: 10:36:33 09/02/02

Go up one level in this thread


On September 02, 2002 at 09:05:20, Ulrich Tuerke wrote:

>On September 01, 2002 at 20:46:55, Pham Hong Nguyen wrote:
>
>>The following article and discussion may be useful for you!
>>
>>http://www.codeguru.com/cpp_mfc/switch.html
>
>I have once looked to the assembly code of a "switch" statement generated on a
>unix RISC platform. This was basically a sequence of if ... else if ...  ... .
>
>However, on CISC platforms, the "switch" statement will be often implemented
>more performance friendly.
>
>Uli


I think it probably depends on (a) the compiler and (b) whether you remember
to add -O or not.  Our sun sparc assembler produces a jump table.  Cray did
also the last time I checked...  Can't get any "RISCier" than those...



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.