]> git.sesse.net Git - stockfish/commitdiff
Reorder data layout and optimize access patern
authorMarco Costalba <mcostalba@gmail.com>
Wed, 23 Sep 2009 16:11:29 +0000 (17:11 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 23 Sep 2009 16:33:24 +0000 (17:33 +0100)
With this very simple patch we get a speed boost
of 0.8% on my PC !

Sometime we find the most complex tricks to increase speed
when instead the best results come from the simplest solutions.

No functional change of course ;-)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/position.h

index a051ec382f49fe15a0d3ee55238e97a48c1158ac..4f6f2d5383b72c861e56db32e27a22110e37014e 100644 (file)
@@ -298,12 +298,12 @@ private:
   template<GamePhase> Value compute_value() const;
   Value compute_non_pawn_material(Color c) const;
 
   template<GamePhase> Value compute_value() const;
   Value compute_non_pawn_material(Color c) const;
 
-  // Bitboards
-  Bitboard byColorBB[2], byTypeBB[8];
-
   // Board
   Piece board[64];
 
   // Board
   Piece board[64];
 
+  // Bitboards
+  Bitboard byTypeBB[8], byColorBB[2];
+
   // Piece counts
   int pieceCount[2][8]; // [color][pieceType]
 
   // Piece counts
   int pieceCount[2][8]; // [color][pieceType]