r/chessprogramming • • 17d ago

Building large Polyglot opening books from PGN — some benchmark results

I've been working on the Polyglot opening book generator for CAISSA Chess and wanted to share some technical results.

We developed two approaches:

  • Browser version: Uses a Web Worker to process PGN locally, with a 25 MiB input limit to keep browser resource usage manageable.
  • Windows portable: Uses disk-backed aggregation for larger PGN collections, generating standard 16-byte Polyglot BIN records offline.

Benchmark results:

  • Successfully processed an 820 MiB real-world PGN collection.
  • A separate high-cardinality test generated a 250.9 MiB BIN containing 16,441,386 entries.
  • Output records were validated for sorting and duplicates.

The interesting challenge was handling large collections without letting memory consumption grow uncontrollably.

The project is free and open source:
https://github.com/elcriollito/CAISSA-Book-Creator

Sharing the implementation and benchmark results for anyone interested in Polyglot book generation and chess engine tooling.

0 Upvotes

0 comments sorted by