Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: OT: switch Statement Performance Consideration

Author: Robert Hyatt

Date: 16:22:29 09/02/02

Go up one level in this thread


On September 02, 2002 at 17:24:00, Jesper Antonsson wrote:

>On September 02, 2002 at 13:09:17, Robert Hyatt wrote:
>>The question becomes how large can the jump table be?  The answer is, it can
>>be as large as you are willing to bear.  It costs memory.  In the "old days"
>>the table had to be pretty small, but today, you could easily have values
>>like 0, 100000 if you wanted to optimize for speed rather than for memory.
>
>Well, nowadays, you also have to consider branch prediction and instruction
>cache issues. I wouldn't be sure that a big jump table would be as efficient if
>you just have a few interesting values, if I hadn't tested it.


A cache line is only 32 bytes long (64 on new PIV systems).  That is either
8 jump addresses or 16.  I don't think that the jump table will cause any
adverse issues because of that...



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.