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

Update README.md #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ https://zhuanlan.zhihu.com/p/31758048

## 标准测试

标准测试主要测试默认 hash 函数,验证键值基本均匀的情况下,不必传统容器慢
标准测试主要测试默认 hash 函数,验证键值基本均匀的情况下,不比传统容器慢

gcc -O3 -Wall test_map.cpp -o test_map -lstdc++ -lm

Expand Down Expand Up @@ -105,4 +105,4 @@ https://zhuanlan.zhihu.com/p/31758048

通过上面的工作,我们得到了这个最不坏的哈希表,我们用它做一个类似 redis / mq 的服务,存储百万级别的键值不用太过在意数据哈希值分布不均匀所带来的问题了,也不用担心碰撞攻击会让其性能跌落到深渊。

我们没法完全依赖哈希函数,当哈希函数靠不住时,还得靠哈希表本身,这叫打铁还需自身硬嘛,最终测试基本符合我们的初衷和预期。
我们没法完全依赖哈希函数,当哈希函数靠不住时,还得靠哈希表本身,这叫打铁还需自身硬嘛,最终测试基本符合我们的初衷和预期。