THPDFType3GlyphCacheStats 记录
报告渲染时使用的 Type 3 字形 CharProc 缓存的命中、未命中、逐出与绕过行为
声明
THPDFType3GlyphCacheStats= record
EntryCount: Integer;
CachedTokenCount: Integer;
HitCount: Int64;
MissCount: Int64;
EvictionCount: Int64;
OversizeBypassCount: Int64;
end;
单元
HPDFPageRenderer
字段
| 字段 | 用途 |
|---|---|
EntryCount | 单次渲染缓存当前持有的 Type 3 字形过程数量 |
CachedTokenCount | 各缓存字形过程合计持有的内容令牌总数,受缓存预算约束 |
HitCount | 由缓存提供而无需重新解释的字形过程数 |
MissCount | 缓存中找不到而重新解释的字形过程数 |
EvictionCount | 为保持在令牌预算内而从缓存丢弃的字形数 |
OversizeBypassCount | 过大而无法缓存的字形,直接解释、不进缓存 |
使用说明
- 每次页面渲染上报自己的计数器,最近的值可通过
THotPDF.GetLastType3GlyphCacheStats读取 OversizeBypassCount偏高说明字形 CharProc 超出缓存预算,每次使用都要重新解释- 跨渲染共享缓存在
THPDFRendererSharedCacheStatistics中维护单独的计数器