* refactor: use a single timestamp in policy backend Prior to this PR we had at least 1 `TimeProvider::now` calls per GET request (for caches that only used LRU) and up to 3 calls (caches with LRU + refresh + TTL). Let's instead use a single timestamp that is created by the policy backend itself (instead of the policies). This has the following consequences: - **efficiency:** `SystemProvider::now` is not free, even though under Linux this doesn't result in a syscall, it uses the stdlib time system which also checks for monotonicity - **consistency:** All changes for a single trigger (e.g. a GET cache call) now use a single timestamp instead of slightly increasing ones. I argue this is the better semantic, simpler to understand and better to debug. For some (slightly artificial) local performance experiment, this shaves off around 2ms per single-table SQL query. However I expect that there might be more degenerated cases (e.g. multi-table SQL queries or some InfluxRPC requests that hit multiple tables). The majority of this patch is moving the `TimeProvider` from the policies into the policy backend. * docs: explain `now` parameter |
||
|---|---|---|
| .. | ||
| benches | ||
| src | ||
| Cargo.toml | ||