项目作者: yiransheng

项目描述 :
Learning project, try to write a functioning redis-server for some basic commands
高级语言: Rust
项目地址: git://github.com/yiransheng/rust-toy-redis.git
创建时间: 2018-04-05T01:28:37Z
项目社区:https://github.com/yiransheng/rust-toy-redis

开源协议:

下载


rusty-toy-redis

A Learning project to write a redis server.

See PLANS.md for ideas I wanted to try.

See CHECKPOINT.md for current status of the code.

Supported Commands

Only SET, GET and DEL

Networking Protocol

Full RESP protocol is implemented, should be able to fool redis-cli

Benchmark

  1. #> redis-benchmark -t set,get -n 100000 -q
  2. # On my computer
  3. #> SET: 149476.83 requests per second
  4. #> GET: 153374.23 requests per second

Rust is pretty amazing, achieving this level of performance for some beginner-level code.

For comparison, same benchmark run on actual redis server:

  1. #> SET: 162337.66 requests per second
  2. #> GET: 165289.25 requests per second

(A naive version that handles each connection with a new thread I had previously completely choked on 100000 connection benchmark above; Yeah, tokio..)

Also run the same benchmark on simpledb, a python based redis compatible key-value server; for a sense of how much low level languages matter in terms of perf:

  1. #> SET: 25374.27 requests per second
  2. #> GET: 28129.39 requests per second