The article discusses innovative ways of compressing chess moves through encoding, allowing for significant reductions in database size and enhancements in query performance. The author highlights the inefficiencies of traditional text notation and explores different encoding strategies to more efficiently store chess moves, showcasing potential savings in storage space. Furthermore, the article outlines the impact of these methods on database performance and touches on the prowess of computers in handling these encoding and decoding operations efficiently.
Main Points
Inefficiency of Text Notation
The current text notation of chess moves, such as Qxf7 (queen takes on f7), is highly inefficient for storage purposes.
Efficient Encoding of Moves
Through clever encoding, it’s possible to significantly compress the number of bits needed to store a chess move, achieving savings of up to 71.43%.
Real-world Application Benefits
Real-world application of this encoding method can lead to a substantial reduction in database size and enhancement in query speed, driving significant performance improvements.
Insights
Encoding chess moves can drastically reduce database size and improve query speed
This hasn’t been deployed yet, I’m working on a ton of other performance improvements. But I anticipate this along with EPD compression (which I may write another at article on) will reduce the size of the database by about 70%. We’re almost entirely read-constrained, which should mean a 3x speedup for the most expensive queries we run.
Computers are extremely efficient at encoding and decoding operations
Another consideration here is the speed of doing this encoding/decoding; will it just cancel out the gains from having a much smaller database? Turns out, computers are really fast at this stuff, and conversion to and from this encoding is a rounding error. Encoding and then decoding 1000 moves takes about 600,000ns, or 0.6ms.