Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

官方文档对Badger理解错误 #89

Open
butaixianran opened this issue Feb 5, 2021 · 1 comment
Open

官方文档对Badger理解错误 #89

butaixianran opened this issue Feb 5, 2021 · 1 comment
Assignees

Comments

@butaixianran
Copy link

这个issue不是程序bug,是文档有误导。

官方文档反复提到Badger写入慢。那是因为Badger自带了多种压缩方案,且默认启用压缩率最高、CPU占用最高的压缩方案。所以使用默认配置才慢。它的思路是:

  • 编译环境启用CGO,就采用ZSTD压缩,这个是重度压缩,CPU占用率高。
  • 编译环境不使用CGO,就采用Snappy压缩,这个是轻量级压缩,也是RocksDB默认的压缩方案。
  • 可以自己改启动配置为不压缩。

另外,他还有数据加密,还要写cache,还有很多用内存换性能的选项可以设置,所以很难用默认配置来衡量它的性能。基本可以认为,简单配置之后,它的读写性能和goleveldb是一个水平,但是略微差一点。

@xujiajun
Copy link
Member

@butaixianran 当时为了快速比较,没有深究他的配置,以为是默认最好的配置方式。谢谢指出,我有时间学习验证下你的结论。再来更新文档,更新完,再完结这个issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants