[ 
https://issues.apache.org/jira/browse/OAK-12426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18120656#comment-18120656
 ] 

Rishabh Daim commented on OAK-12426:
------------------------------------

h2. Initial benchmark implementation and results

*Branch*: {{issue/OAK-12426}}
*Reference*: [PR 2898|https://github.com/apache/jackrabbit-oak/pull/2898]
*Command*: {{java -Xmx2g -Ddocument.cache.threads=8 -jar 
oak-benchmarks/target/oak-benchmarks-2.7-SNAPSHOT.jar benchmark 
DocumentCacheBenchmark Oak-MemoryNS}}
*Configuration*: 10,000 cache entries, 2,000,000 measured operations per 
scenario, 8 concurrent threads, fixed seed 42, three full JVM runs. The table 
reports medians. Both policies use the Oak cache API, EmpiricalWeigher, 
identical maximum weight, and the production CacheLIRS segment/average-weight 
settings.

|| Scenario || Ratio || Caffeine throughput vs LIRS || Hit-rate delta || 
Backend-load ratio ||
| STEADY_STATE | 0.5x | 0.83x | +0.00 pp | 1.00x |
| STEADY_STATE | 1.0x | 1.30x | +0.32 pp | 0.61x |
| STEADY_STATE | 2.0x | 0.93x | +0.01 pp | 1.00x |
| CHURN | 0.5x | 1.25x | +0.00 pp | 1.00x |
| CHURN | 1.0x | 1.07x | +2.11 pp | 0.19x |
| CHURN | 2.0x | 1.18x | -6.25 pp | 1.16x |
| INVALIDATION | 0.5x | 0.62x | +0.00 pp | 1.00x |
| INVALIDATION | 1.0x | 0.60x | +0.30 pp | 0.96x |
| INVALIDATION | 2.0x | 0.88x | -1.50 pp | 1.08x |
| CONCURRENT | 0.5x | 3.02x | +0.00 pp | 1.00x |
| CONCURRENT | 1.0x | 3.18x | +0.32 pp | 0.61x |
| CONCURRENT | 2.0x | 1.25x | +0.99 pp | 0.92x |

h3. Initial conclusion
Caffeine is substantially faster under concurrent access and improves 
admission/backend loads for cache-sized steady/churning sets. It is not 
uniformly at least as fast: explicit invalidation throughput is 38-40% lower at 
0.5x/1.0x, and the 2.0x churn workload has a 6.25 percentage-point lower hit 
rate with 16% more backend loads. OAK-12425 should remain blocked while these 
regressions are investigated and the benchmark PR is reviewed.

> Benchmark CacheLIRS and Caffeine for oak-store-document
> -------------------------------------------------------
>
>                 Key: OAK-12426
>                 URL: https://issues.apache.org/jira/browse/OAK-12426
>             Project: Jackrabbit Oak
>          Issue Type: Task
>            Reporter: Rishabh Daim
>            Assignee: Rishabh Daim
>            Priority: Major
>
> h3. Summary
> Add reproducible performance benchmarks comparing CacheLIRS and the 
> Caffeine-backed Oak cache for oak-store-document before Caffeine becomes the 
> default under OAK-12425.
> h3. Scope
> * Add the benchmark to {{oak-benchmarks}} so benchmark-only code is reviewed 
> and run independently from the production default switch.
> * Exercise representative DocumentNodeStore cache workloads through 
> production cache APIs, including steady-state reads, churn/eviction, 
> invalidation, and concurrent access.
> * Compare throughput, latency, hit/miss rate, eviction behavior, and 
> loader/backend-read count for CacheLIRS and Caffeine with identical cache 
> weights and deterministic workloads.
> * Include warm-cache and cold-cache scenarios and multiple 
> working-set-to-cache-size ratios.
> * Document an exact command, JVM settings, workload parameters, and a concise 
> result table.
> h3. Reference
> Use the benchmark structure and reporting patterns from 
> [apache/jackrabbit-oak PR 
> 2898|https://github.com/apache/jackrabbit-oak/pull/2898], adapting them to 
> oak-store-document caches rather than segment caches.
> h3. Acceptance Criteria
> # Both CacheLIRS and Caffeine run against identical deterministic 
> DocumentNodeStore cache workloads.
> # Results report throughput/latency plus hit, miss, eviction, and 
> backend-load counts.
> # Benchmarks cover steady-state, cache churn, invalidation, and concurrent 
> access with at least three working-set/cache-size ratios.
> # The benchmark can be selected from BenchmarkRunner and its run command and 
> JVM requirements are documented in code or existing benchmark documentation.
> # Results demonstrate whether Caffeine is at least as performant as CacheLIRS 
> for the representative workloads; any regression is quantified and 
> investigated.
> # Benchmark changes are delivered in a PR separate from OAK-12425.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to