-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Benchmarks
The benchmarks use Java microbenchmark harness to provide an accurate analysis. To be fair when judging the throughput, Guava was configured with a concurrency level of 64
. The default, 4
, reduces memory usage at a cost of 2-3x performance. Run on a MacBook Pro i7-4870HQ CPU @ 2.50GHz (4 core) 16 GB Yosemite.
In this benchmark the caches are unbounded, fully populated, and the computation returns a constant value. This benchmark demonstrates the overhead due to locking when computing the value if the entry is not present. Caffeine performs a lock-free prescreening before falling back to an atomic compute if absent call. The scenarios graphed are all threads retrieving a single entry ("sameKey") and threads retrieving different keys based on a Zipf distribution ("spread").
In this benchmark 8 threads concurrently read from a cache configured with a maximum size.
In this benchmark 8 threads concurrently write to a cache configured with a maximum size.
In this benchmark 6 threads concurrently read from and 2 threads write to a cache configured with a maximum size.