openmessaging / dledger

A raft-based java library for building high-available, high-durable, strong-consistent commitlog.
Apache License 2.0
804 stars 316 forks source link

Replace map with circular array #152

Open Cczzzz opened 2 years ago

Cczzzz commented 2 years ago

使用环形数组替换 map ,以提高性能。 另外在多线程写入,非公平锁下,会出现 23456789 1 的顺序写入消息,导致23456789 都会等待第1条, 我测试下 1w tps 最多同时堵塞超过 300 条消息。

tsunghanjacktsai commented 2 years ago

By which places you'd like to replace circular arrays over maps? Welcome to open a PR for this :-)