GithubHelp home page GithubHelp logo

redis-pipeline-testing's Introduction

## redis-pipeline

我们都知道大批量有规律的redis写操作,用pipeline模式能够极大提高效率。
在Java开发中,SpringBoot对Redis做了很好的支持,可以支持Jedis和Lettuce,但在业务层可以通过RedisTemplate来屏蔽这些底层细节。
那么基于RedisTemplate的pipeline性能怎样呢?

## Data

[Performance.java](src/main/java/com/example/demoredispipeline/Performance.java)中
对RedisTemplate不采用pipeline模式,在pipeline模式下分别基于template和connection方式进行了测试,最后加上了Jedis pipeline。

数据如下:

 * cost 74529243 ns in jedis pipeline
 * cost 4006613513 ns in normal mode
 * cost 3726327129 ns in pipeline
 * cost 252239947 ns in bytes pipeline

 可见,如果要用pipeline,基于原生的Jedis Pipeline性能会最好,如果是在Spring的RedisTemplate下,应该用connection来操作。
 如果不用connection操作,而是基于RedisTemplate,实际上是没有什么效果的。
 不要用错了方法哦。

redis-pipeline-testing's People

Watchers

 avatar

Forkers

zyzhuaidan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.