Skip to content
sshaplyginPublic

Latest commit

 

History

120 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

as-cache — Adaptive Selection Cache

CI Go Reference Go Report Card License: MPL 2.0

as-cache is an experimental Go library for studying adaptive cache-policy selection. For a general-purpose production cache, start with otter or theine; see the measured comparison.

The best eviction policy depends on the workload. Across twelve published trace workloads, different fixed policies lead. This library measures that choice at runtime: one policy is active and serves requests, while the others run as shadows that track keys and eviction state without payload values. Once per epoch a multi-armed bandit selects a policy. Switching is unconditional by default; optional stability gates can restrict it.

Measurement does not guarantee an improvement or a floor relative to a fixed policy. The current results report repeated observations, small margins and ties, effective sampling, an object/byte comparison and an offline ObserveOnly sweep. ObserveOnly collects advice while keeping the configured policy active. Its final choices are compared retrospectively with standalone policy medians; those differences do not measure a serving loss from following advice.

It is pre-1.0, the API may change, and production use has not been established. The repository includes nine policy arms; S3-FIFO and SIEVE are experimental adapters planned for v0.5; their module is excluded from v0.4. The evidence links to raw results, input checksums and the measured revision. Reproduce the dataset with the three-batch recorder; make evidence runs one diagnostic batch. Random sampling, Random and asynchronous W-TinyLFU mean some numbers vary between runs. make evidence-check verifies the retained measurements and exact generated tables without rerunning the experiments.

Documentation

Document Contents
Getting started Install, a working example, and the AdaptiveCache API
Design How it works per request and per epoch, when it fits, the Bandit interface, what is not done
Configuration Every Settings field, migration strategies, sampling, stability gates, tuning
Policies The nine ready-made arms, their caveats, adapting your own cache
Advisor mode ObserveOnly, Advice(), and the metrics module
Evidence Every measured claim: policy tables, competing libraries, real traces, sampling fidelity
Benchmarking Reproducible replays, benchclient, make evidence
Releasing Development workspace, candidate checks, publication and upgrade notes
Project site Project overview and documentation

Past releases are recorded in the changelog and on the releases page.

License

Mozilla Public License 2.0 — file-level copyleft. You may use this library in a closed-source application without opening your own code; if you modify one of these files and distribute the result, that file's source must be made available under the same licence. Each publishable module carries its own copy, because a Go module zip contains only its own directory.

Releases

Packages

Used by

Contributors

Languages