Cache cost class
A cache cost class groups objects that share an estimate of the cost of fetching or recomputing a missing value.
Cost-aware hyperbolic caching multiplies access frequency by estimated miss cost. A shared class estimate can change the priority of resident members without fetching each one again. Objects reference the class and use its current estimate when evaluated. [1]
Per-object measurements can favor an accidentally slow fill; retaining that object then limits opportunities to remeasure it. Pooling comparable fills can reduce noise, but grouping unrelated costs can mislead the policy. [1]
Constructed example: equal-size residents A and B have frequencies 2 and 1 accesses/s and class costs 8 and 20 ms/fill, giving scores 16 and 20 ms/s. Updating A's class with a 32 ms fill and new-sample weight 1/4 gives 14 ms/fill and score 28 ms/s. The lower-score candidate changes from A to B without either resident being accessed. The score is an estimate, not measured saved time. [5]
On Unix, the pinned prototype combines recorded SQL durations with process CPU time for its cost signal; it separately records wall-clock elapsed time. Its adapter converts the former to an integer after multiplying by 100 and sends a class identifier based on the resolved URL name. These signals are not interchangeable latency measurements. [2] [3] [4]
Relations
- related
- Hyperbolic caching, Storage latency
Limitations
- In the paper's Django-Wiki experiment, class-aware caching improved on per-object cost estimates but still underperformed cost-oblivious hyperbolic caching. Cost awareness is workload-dependent. [1]
Citations
- Blankstein, Sen and Freedman. Hyperbolic Caching. USENIX ATC 2017, pp. 499-511, sections 3.1-3.2 and 5.1.4, Figure 7.
- Author prototype: timing boundaries and get_url_name; commit 884c466c311bb5b9fbdd09791d829b04032f3947.
- Author prototype: HyperbolicCache.set cost conversion and class mapping; same pinned commit.
- CPython 2.7.13 documentation: time.clock has processor-time semantics on Unix and elapsed wall-time semantics on Windows.
- Hesela: exact shared-cost priority calculation, units, assumptions and executable model.
Further reading
Sources & caveats
- Primary-paper and pinned-code review, plus constructed exact arithmetic. No legacy middleware execution or reproduction of application throughput.
- The illustrative smoothing weight is chosen for explanation, not extracted from the prototype. Frequency, object size and resident identity are held fixed while the class estimate changes.