6.1. Reducing the Data Type Bit-Width
- When Freecell Solver started it represented each card and stack length specifier as a 32-bit quantity.
- This caused it to run out of memory or stack in some cases.
- To resolve it, I converted it to use 8-bit bytes.
- This did not only consume less memory but also made it much faster.
- I queried the Linux-IL mailing-list about it and received some answers.
The most probable reasons: less memory -> less cache misses, and handling bytes is just as fast as handling ints.
Update: It may also have to do with the limited size of the CPU cache lines, typically 32 bytes on 32-bit x86 CPUs. The more items fit into a cache lines, the less cache misses there are.