Skip to content

Commit

Permalink
Reorder members of Material::Entry
Browse files Browse the repository at this point in the history
This eliminates alignment padding and reduces size from 48 to 40 bytes.
This makes the material HashTable smaller and more cache friendly.

No functional change

Closes #1013
  • Loading branch information
mstembera authored and zamar committed Feb 24, 2017
1 parent 9f48e1e commit f1e3dfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/material.h
Expand Up @@ -56,11 +56,11 @@ struct Entry {
}

Key key;
int16_t value;
uint8_t factor[COLOR_NB];
EndgameBase<Value>* evaluationFunction;
EndgameBase<ScaleFactor>* scalingFunction[COLOR_NB]; // Could be one for each
// side (e.g. KPKP, KBPsKs)
int16_t value;
uint8_t factor[COLOR_NB];
Phase gamePhase;
};

Expand Down

1 comment on commit f1e3dfe

@lucasart
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With all their cleverness, it surprises me that compilers can't figure that out by themselves...

Please sign in to comment.