I'm testing the performances of EhCache and I'm surprised to find that it seems 1 order of magnitude slower than a ConcurrentHashMap when used as a local, in-memory cache with no transaction.
I ran the test using the RadarGun framework (https://github.com/radargun/radargun). The characteristics are:
- 1 thread only
- 50K keys, 500K operations (30% puts)
- JVM size 1GB (-Xmx == -Xms == 1024M)
- object size: 3K
- basic configuration : 1000000 max entries in cache, alternate config: 30K entries max + eviction on disk
I pasted at the end of this message the obtained data (raw CSV data).
Surprisingly, the in-memory version of ehcache is almost 6 times slower than a concurrent hash map. I was expecting much closer performances for basic caching with no transaction, no eviction, no distribution. I used custom keys, but we are using them a lot and the distribution of the hash seems OK.
Do you have an idea what could explain slow performances like this?