Skip to content

Commit

Permalink
docs: upload aeloop pic
Browse files Browse the repository at this point in the history
  • Loading branch information
xgzlucario committed Dec 1, 2024
1 parent 7c0660f commit 3c97560
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ This is rotom, a high performance, low latency tiny Redis Server written in Go.

AeLoop (Async Event Loop) is the core asynchronous event-driven mechanism in Redis, which mainly includes:

![img](asserts/aeloop.png)

1. FileEvent: Uses I/O multiplexing to handle read and write events on network sockets, categorized into `READABLE` and `WRITABLE`.
2. TimeEvent: Handles tasks that need to be executed after a delay or periodically, such as expiring items every `100ms`.
3. When events are ready, they are processed by callback functions bound to those events.
Expand All @@ -36,7 +38,7 @@ In rotom, the AeLoop event loop mechanism in Redis is replicated, specifically:
## Data Structures

Rotom has made several optimizations in data structures:
s

- dict: Rotom uses `stdmap` as the db hash table, with built-in progressive rehashing.
- hash: Based on `zipmap` with higher memory efficiency.
- set: Uses `zipset` when the set is small and `mapset` when it is large.
Expand All @@ -47,7 +49,7 @@ Notably, `zipmap` and `zipset` are space-efficient data structures based on `lis

## Benchmark

![img](bench.jpg)
![img](asserts/bench.jpg)

The test will run rotom on the same machine with `appendonly` disabled, and use `redis-benchmark` tool to test the latency of different commands.

Expand Down
6 changes: 4 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

AeLoop(Async Event Loop) 是 Redis 的核心异步事件驱动机制,主要有以下部分:

1. FileEvent:使用 IO 多路复用处理网络 socket 上的读写事件。事件分为 `READABLE``WRIABLE`
![img](asserts/aeloop.png)

1. FileEvent:使用 IO 多路复用处理网络 socket 上的读写事件。事件分为 `READABLE``WRITABLE`
2. TimeEvent:处理需要延迟执行或定时执行的任务,如每隔 `100ms` 进行过期淘汰
3. 当事件就绪时,通过该事件绑定的回调函数进行处理

Expand All @@ -47,7 +49,7 @@ rotom 在数据结构上做了许多优化:

## 性能

![img](bench.jpg)
![img](asserts/bench.jpg)

测试将在同一台机器上,关闭 `appendonly`,并使用 `redis-benchmark` 工具测试不同命令的 qps。

Expand Down
Binary file added asserts/aeloop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit 3c97560

Please sign in to comment.