0

Use spring-data-redis, when I do this action

    hashOperations = redisTemplate.opsForHash();
    return hashOperations.values(this.getEntityClass().getName());
    //or use this,the same
    //return hashOperations.entries(this.getEntityClass().getName());

it runs so slow, return 10000 objects need 700ms. if I use memcache, it just need 15ms, so what should I do with spring-data-redis

doubleevil
  • 41
  • 2
  • Can you provide a reproducible test case? Here's the link to a self-contained test case template: https://gist.github.com/mp911de/73d4b95b04a66eae084395beb25bd499. – mp911de Nov 24 '16 at 09:28
  • thanks, It's my great honor to ask your question, here is the link. https://gist.github.com/doublEeVil/86cb9c10d30818440969cf1406d8bf49 – doubleevil Nov 24 '16 at 10:53
  • I am wrong , use ehcache need 15ms, not memcached – doubleevil Nov 24 '16 at 11:10
  • In this case the whole comparison does not make any sense. Redis is a remote service while EHCache is a in-memory cache that lives inside the JVM. EHCache requires no I/O (except for replication but that's a different thing). – mp911de Nov 24 '16 at 11:22
  • thank you, while put or get single variable in same PC, time difference between redis and ehcache is small, so I think multi get do the same. Thank you very much – doubleevil Nov 24 '16 at 11:46

0 Answers0