chessbaseLinux/claude/memory/search-performance-plan.md
vrubelroman 0d56f2ab3a Private files: memory after 0.16.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 00:09:52 +03:00

32 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: search-performance-plan
description: "Large-base search performance work (2026-10-19): own booster, opening index with RAM check, PGN memory guard, --bench — done locally, not yet pushed/released"
metadata:
node_type: memory
type: project
originSessionId: 86c7ee93-82be-4380-9d11-393872d0bb51
modified: 2026-10-19T16:24:32.309Z
---
On 2026-10-19 the user asked for an audit of filtering/search algorithms and said
"делать всё как ты предлагаешь"; they want RAM used when available ("не жалел бы
оперативку"), a slower path otherwise, and laptops to cope.
Done (commits a7d9d59, 1506ebd, 4b92fa3 on main, as of 2026-10-19 evening, unreleased):
- own `.cbb`-format booster in the cache when the base has no usable one (`chessbase/booster.rs`);
booster skipped for early positions (sampling the first 4096 records);
- opening index `chessbase/openings.rs` (first 10 plies, 600 MB for Mega, built in the same
pass, loaded only when `memory::available()` ≥ size + 1 GiB); misses the rare games that
reach an opening position later by a detour (23 of 5.9M for 1.e4) — documented;
- PGN position-table memory guard (`PgnDb::positions_blocked`), message on the search board;
- `chesspenguin --bench <db> [report.txt]`, dev hook `CP_MEMORY_LIMIT=<MB>`.
- Cache dir for all of it: `~/.cache/chesspenguin/boosters/<hash>.cbb|.cpo`.
Open: measure on a real laptop with `--bench` (4-thread taskset estimate: start 0.29 s with
the index vs 2.2 s without). Ask before pushing/releasing.
**Why:** opening positions match millions of games and no prefilter helps.
**How to apply:** keep results identical to the pass (tests compare them); document
measurements in docs/dev/import.md. See [[release-process]] before shipping.
2026-10-24 (0.16.0): every desktop database uses LargeView (ChessBase-style filters, quick search, position board): chess-import pgn_catalog.rs (PGN tags as Filter/sort/suggest; built in the loading thread), Filter::text quick search for PGN and ChessBase (Mega ~0.1 s via year/ECO tables), converted ChessBase texts marked with the CbText tag, PGN position-table memory estimate from all_plies (was file size ×10, 14× too high on clock-commented files). Spec: docs/design/large-databases.md §9.