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.

站内延伸阅读

链到安装、模型与版本说明,便于 SEO/GEO,非官方 issue 正文。