Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trimmed down cache performance comparison #309

Closed
ljacomet opened this issue Mar 3, 2015 · 3 comments
Closed

Trimmed down cache performance comparison #309

ljacomet opened this issue Mar 3, 2015 · 3 comments
Assignees

Comments

@ljacomet
Copy link
Member

ljacomet commented Mar 3, 2015

Create a trimmed down version of Ehcache that does not support CacheLoaderWriter and then compare its performance with the current Ehcache class.

The goal is to have a measure of the cost of using functions and Store.compute* functions for all operations when there is no CacheLoaderWriter present.

@ljacomet
Copy link
Member Author

Created a jmh based micro benchmark that compares Ehcache 3 with Ehcache 2.9.1.

Result on my machine with Java 1.8.0_31:

$> java -Xms2g -Xmx2g -jar target/benchmarks.jar -t 4 -f 1
(...)
# Run complete. Total time: 00:02:42

Benchmark                               Mode  Cnt          Score         Error  Units
CacheBenchmark.testComputeIfAbsentCHM  thrpt   20   80689508.131 ±  796255.458  ops/s
CacheBenchmark.testGetCHM              thrpt   20  329161816.150 ± 8217034.060  ops/s
CacheBenchmark.testGetEhcache2         thrpt   20   19483378.524 ±  235130.523  ops/s
CacheBenchmark.testGetEhcache3         thrpt   20   30813004.783 ± 1112848.209  ops/s

Will work on including results when running with a trimmed down version of Ehcache.get code path.

@ljacomet
Copy link
Member Author

Test run with Java 1.6.0_65 (and without CHM.computeIfAbsent test):

$> java -Xms2g -Xmx2g -jar target/benchmarks.jar -t 4 -f 1
(...)
# Run complete. Total time: 00:02:03

Benchmark                        Mode  Cnt          Score         Error  Units
CacheBenchmark.testGetCHM       thrpt   20  105037787.070 ? 2861028.627  ops/s
CacheBenchmark.testGetEhcache2  thrpt   20   16542517.765 ?  427401.347  ops/s
CacheBenchmark.testGetEhcache3  thrpt   20   25432309.954 ?  918279.696  ops/s

@ljacomet
Copy link
Member Author

Get MicroBenchmark

Created a Google doc spreadsheet of which the graph above is an extract. The document contains JMH test results and information on the machines it was run on.
Tests were run based on code as found on https://github.com/ljacomet/ehcache3/tree/issue-309. The last commit creates the trimmed down version of Cache.get path, the parent commit is what was used in normal tests.

According to my findings, there is currently not enough value in splitting the code to have a simpler cache un-aware of CacheLoaderWriter as there is no clear performance gain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant