mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
Scale the tablebase cache to ~100k entries (#24)
* Slim the cached tablebase value to the fields the trainer reads (#20) * Sample for LFU eviction instead of scanning the cache (#21) * Make cache size configurable and back up daily off-peak (#22) * Document the cache design in the glossary and an ADR (#23) * Address cache-scaling code review findings
This commit is contained in:
@@ -45,9 +45,6 @@ defmodule Chesstrainer.Endgames.Tablebase.Parser do
|
||||
checkmate: map["checkmate"],
|
||||
dtc: map["dtc"],
|
||||
dtm: map["dtm"],
|
||||
dtw: map["dtw"],
|
||||
dtz: map["dtz"],
|
||||
insufficient_material: map["insufficient_material"],
|
||||
moves: Enum.map(map["moves"], &moves_from_map/1)
|
||||
}}
|
||||
end
|
||||
@@ -55,20 +52,11 @@ defmodule Chesstrainer.Endgames.Tablebase.Parser do
|
||||
defp moves_from_map(map) do
|
||||
%Tablebase.Move{
|
||||
category: Tablebase.normalize_category(map["category"]),
|
||||
checkmate: map["checkmate"],
|
||||
conversion: map["conversion"],
|
||||
dtc: map["dtc"],
|
||||
dtm: map["dtm"],
|
||||
dtw: map["dtw"],
|
||||
dtz: map["dtz"],
|
||||
insufficient_material: map["insufficient_material"],
|
||||
precise_dtz: map["precise_dtz"],
|
||||
san: map["san"],
|
||||
stalemate: map["stalemate"],
|
||||
uci: map["uci"],
|
||||
variant_loss: map["variant_loss"],
|
||||
variant_win: map["variant_win"],
|
||||
zeroing: map["zeroing"]
|
||||
uci: map["uci"]
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user