Code Monkey home page Code Monkey logo

cache_bench's Introduction

The cache_bench is come from the rocksdb. And it's a good example for us to take a deep knowladge of the cache algorithm's implementation with high concurrent in lookup/insert/erase.

cache_bench

  • lru cache
  • clock cache
  • leveldb lru cache

Build

The make file's lib is for mac, if you want to build the cache_bench ,it't better to change the dylib to .so.

  • make cache_bench It's a tool to test the different cache with their options.
  • make cache_lib Compile a cache-lib, and user could use the lru or clock cache easily. Just like the example of the example directroy.

Performance

Environment

Mac pro : Darwin Kernel Version 20.3.0

Benchmark

./cache_bench

 $ ./cache_bench -threads=32 -lookup_percent=100 -erase_percent=0 -insert_percent=0 -num_shard_bits=8
Number of threads   : 32
Ops per thread      : 1200000
Cache size          : 8388608
Num shard bits      : 8
Max key             : 1073741824
Populate cache      : 0
Insert percentage   : 0%
Lookup percentage   : 100%
Erase percentage    : 0%
Test count          : 1
----------------------------
1 Test: complete in 0.767 s; QPS = 50052072

 $ ./cache_bench -threads=32 -lookup_percent=100 -erase_percent=0 -insert_percent=0 -num_shard_bits=8 -use_clock_cache=true
Number of threads   : 32
Ops per thread      : 1200000
Cache size          : 8388608
Num shard bits      : 8
Max key             : 1073741824
Populate cache      : 0
Insert percentage   : 0%
Lookup percentage   : 100%
Erase percentage    : 0%
Test count          : 1
----------------------------
1 Test: complete in 1.216 s; QPS = 31567213

cache_bench's People

Contributors

zhanghuigui avatar

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.