kevo666/packrat-benchmarks
PackRat v2 Benchmarks Version: 2.0.0 Date: 2026-04-10 Tokenizer: tiktoken cl100k_base (GPT-4 / Claude compatible) Platform: Node.js v25.6.1, Windows 11 Summary Metric Result Round-trip accuracy 100% (144/144 tests) Token savings (avg) 2.4% Token savings (best) 17.3% (path/URL-heavy files) Byte savings (avg) 2.5% Search speedup 12.03x Codebook entries 72 (auto-learned) Negative-savings entries 0 Comparison: PackRat vs… See the full description on the dataset page: https://huggingface.co/datasets/kevo666/packrat-benchmarks.
PackRat v2 Benchmarks
Version: 2.0.0 Date: 2026-04-10 Tokenizer: tiktoken cl100k_base (GPT-4 / Claude compatible) Platform: Node.js v25.6.1, Windows 11
Summary
Comparison: PackRat vs MemPalace
PackRat trades peak compression for perfect fidelity. No information is ever lost.
Real-World Results (65 Production Files)
Tested on 65 markdown memory files totaling 249KB / 70,014 tokens. Codebook auto-learned from the same files (72 entries: 20 paths, 35 entities, 17 phrases).
25 of 65 files shown (sorted by savings). All 65 passed round-trip. Full results in data/v2-test-results.json.
Token Savings by Pattern Type
Measured with tiktoken cl100k_base:
v2's token-aware scoring automatically rejects entries like "JavaScript" that cost tokens.
Test Suite (144 tests, 0 failures)
How to Reproduce
git clone https://github.com/kevdogg102396-afk/packrat
cd packrat
pip install tiktoken
PYTHON_PATH=$(which python) node benchmark/bench.mjs
PYTHON_PATH=$(which python) node benchmark/tests/v2-edge-cases.mjsMethodology
- Token counting: tiktoken cl100k_base via Python subprocess (batch mode)
- Round-trip test:
decompress(compress(original)) === original(exact string equality) - Codebook: Auto-learned from the same files being tested (no external training data)
- No cherry-picking: All 65 files in the memory directory were tested, results reported for every file
- Secrets filter: Lines containing API keys, tokens, or credentials are stripped before learning
