-
Notifications
You must be signed in to change notification settings - Fork 238
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
Hyperloglog 增加部分注释 #111
base: 7.0-cn-annotated
Are you sure you want to change the base?
Hyperloglog 增加部分注释 #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对位运算不是很熟悉,也还没有想着去搞懂 HLL 里的具体算法,所以中间部分计算 6 bits 部分没有细看
@huihuang-chen 也请帮忙看一眼
src/hyperloglog.c
Outdated
* * +--------+--------+--------+------// | ||
* |11000000|22221111|33333322|55444444 | ||
* +--------+--------+--------+------// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* * +--------+--------+--------+------// | |
* |11000000|22221111|33333322|55444444 | |
* +--------+--------+--------+------// | |
* +--------+--------+--------+------// | |
* |11000000|22221111|33333322|55444444 | |
* +--------+--------+--------+------// |
src/hyperloglog.c
Outdated
* +--------+ +--------+ | ||
* 下标为 0 的字节数组 下标为 1 的字节数组 | ||
* | ||
* 因此给寄存器重新设置值可以分为两部: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 因此给寄存器重新设置值可以分为两部: | |
* 因此给寄存器重新设置值可以分为两步: |
这个pr有朋友来 review下嘛 |
* ZERO 操作码:占用 1 个字节,表示为 00xxxxxx,后六位表示有 2^6 + 1 个寄存器可以被设置为 0 | ||
* XZERO 操作码:占用 2 个字节,表示为 01xxxxxx yyyyyyyy,表示有 2^14 + 1 个寄存器可以被设置为 0 | ||
* VAL 操作码:占用 1 个字节,表示为 1vvvvvxx。vvvvv 表示值,范围为 1-2^5。后两位 xx 表示数量 2^2,整体表示为最多有 2^2 个寄存器被设置为值 vvvvv */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边应该是减 1 吧
* ZERO 操作码:占用 1 个字节,表示为 00xxxxxx,后六位表示有 2^6 + 1 个寄存器可以被设置为 0 | |
* XZERO 操作码:占用 2 个字节,表示为 01xxxxxx yyyyyyyy,表示有 2^14 + 1 个寄存器可以被设置为 0 | |
* VAL 操作码:占用 1 个字节,表示为 1vvvvvxx。vvvvv 表示值,范围为 1-2^5。后两位 xx 表示数量 2^2,整体表示为最多有 2^2 个寄存器被设置为值 vvvvv */ | |
* ZERO 操作码:占用 1 个字节,表示为 00xxxxxx,后六位表示有 2^6 -1 个寄存器可以被设置为 0 | |
* XZERO 操作码:占用 2 个字节,表示为 01xxxxxx yyyyyyyy,表示有 2^14 -1 个寄存器可以被设置为 0 | |
* VAL 操作码:占用 1 个字节,表示为 1vvvvvxx。vvvvv 表示值,范围为 1 到 (2^5 -1)。后两位 xx 表示数量 2^2,整体表示为最多有 2^2 -1 个寄存器被设置为值 vvvvv */ |
写完发现另一位朋友2月8号已经提交了大部分 hyperloglog 的内容
这里加上我写的部分内容