PDFium Delphi Component Docs

StructureCacheHitCount property

Component: TPdf  ·  Unit: PDFium
Counts structure element reads served from a retained page structure tree

Syntax

property StructureCacheHitCount: Int64; // read only

Description

The counter increments once for every StructureElementsForPage or StructureElements access whose page already holds a valid cached tree. The hit refreshes the page slot in least-recently-use order, touches the entry in the shared cache governor and returns a deep clone of the retained snapshot

The value is cumulative for the lifetime of the TPdf instance and never resets, so a rising hit rate shows that repeated accessibility validation and structure traversal reuse one parse

Remarks

Reading is guarded by the render lock used by native PDFium page access

Capacity changes, page edits, document reloads and clears preserve the counter; they change what is retained, not what already happened

Pair the value with StructureCacheMissCount to compute the effective hit ratio

Example

for I := 1 to PageCount do
  AuditStructure(Pdf.StructureElementsForPage[I]);
Ratio := Pdf.StructureCacheHitCount /
  (Pdf.StructureCacheHitCount + Pdf.StructureCacheMissCount);

See Also

StructureCacheMissCount, StructureCacheCount, StructureCacheCapacity, StructureElementsForPage