I've manually traced through the bloom filter code to work out how big a filter ends up being a few times now; this just adds some python code as a comment so it's easy to do that by cutting and pasting into an interpreter instead.
doc: make it easier to work out size of bloom filter #19130
pull ajtowns wants to merge 1 commits into bitcoin:master from ajtowns:202005-bloom-doc changing 1 files +12 −1-
ajtowns commented at 4:29 AM on June 1, 2020: member
-
doc: make it easier to work out size of bloom filter d896aee3ae
- fanquake added the label Docs on Jun 1, 2020
-
sipa commented at 4:42 AM on June 1, 2020: member
Looks right, but perhaps it should go in the .h file (which has an easier approximate formula already).
-
MarcoFalke commented at 11:54 AM on June 1, 2020: member
An alternative would be to run the code in massif and show the size of the object. :grimacing:
-
sipa commented at 11:19 PM on June 1, 2020: member
To have an idea of the approximation, the formula "4.328 bits per element and per bit of fprate" is at most 0.115% off for better than 8-bit fprate (fprate < 1/256). For 10-bit, at most 0.074%. For 12-bit, at most 0.052%. For 20-bit, 0.019%.
-
laanwj commented at 6:53 PM on July 22, 2020: member
Looks right, but perhaps it should go in the .h file (which has an easier approximate formula already).
I agree. In general, this kind of documentation would be better in the header file. This also gets included in doxygen etc.
- fanquake added the label Waiting for author on Aug 23, 2020
- fanquake added the label Up for grabs on Sep 15, 2020
- fanquake closed this on Sep 15, 2020
- fanquake removed the label Up for grabs on Sep 17, 2020
- fanquake removed the label Waiting for author on Sep 17, 2020
- laanwj referenced this in commit e12ad7f383 on Nov 19, 2020
- sidhujag referenced this in commit 283a159512 on Nov 19, 2020
-
jnewbery commented at 9:36 AM on February 14, 2021: member
This is really helpful. I'd love to see it merged into the header file at some point.
- PastaPastaPasta referenced this in commit d4c943a872 on Jun 27, 2021
- PastaPastaPasta referenced this in commit fb5804a0b2 on Jun 28, 2021
- PastaPastaPasta referenced this in commit 108c9b1891 on Jun 29, 2021
- PastaPastaPasta referenced this in commit fc333b0a9a on Jul 1, 2021
- PastaPastaPasta referenced this in commit 1d3ab5aa9d on Jul 1, 2021
- PastaPastaPasta referenced this in commit 101a0bba40 on Jul 15, 2021
- PastaPastaPasta referenced this in commit e376c205dd on Jul 15, 2021
- PastaPastaPasta referenced this in commit a9b5723556 on Jul 16, 2021
- gabriel-bjg referenced this in commit 105338f255 on Jul 16, 2021
- gades referenced this in commit c34b31e2ae on Apr 25, 2022
- DrahtBot locked this on Aug 16, 2022
Labels