日志模板保存疑问 #42
EvanYoung7
started this conversation in
General
Replies: 1 comment 1 reply
|
如果是正常Hash表,一定是先验证Hash相等,然后再做一个equal判断。 这样才能有100%的保险。 但是如果是这样,就意味着我们需要有大量的内存来做format内容的保存或者回溯文件查询。 对性能都非常不好。 目前的hash是64位的,碰撞几率极低。我们在上亿用户的产品中都用的这种方式。还没有发现过碰撞。 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
看 appender_file_compressed.cpp 代码,发现只将日志模板的哈希值保存到哈希表中,但这样的话不会出现哈希冲突导致格式化错误吗?
All reactions