Pull requests / #855

#855 Refactor PageCache to fix a 45× read amplification

closed · @AncientMystic · 0 コメント · GitHub で見る

本文

PLE PageCache fixes a 45× read amplification

Updated the caching mechanism to use a page-granular cache instead of a row cache, improving memory efficiency and correctness when accessing rows that span page boundaries.

Upstream caches **rows** of the n-gram table. A row cache keeps 90 B of every 4096 B page read, so a straddling row is *never* served from it and re-reads from RAM every time — in a set-associative cache two pages are not adjacent, so serving the tail would read junk. Measured amplification **45×**, fixed by caching whole pages instead. 

This is a correctness-shaped bug in a performance feature: the cache looks like it works and silently does not. 

this fix once applied, leads to a 45× reduction in RAM traffic on the PLE path.

関連リンク

インストール・モデル・リリースへの站内リンク。