aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorMartin Ankerl <[email protected]>2018-05-06 13:55:33 +0200
committerMartin Ankerl <[email protected]>2018-05-06 13:55:33 +0200
commit9aac9f90d5e56752cc6cbfac48063ad29a01143c (patch)
treed31c9257dcb47c522d20b2859c87e164dd7eb8ca /src/httpserver.cpp
parentMerge #13080: mempool: Add compile time checking for ::mempool.cs runtime loc... (diff)
downloaddiscoin-9aac9f90d5e56752cc6cbfac48063ad29a01143c.tar.xz
discoin-9aac9f90d5e56752cc6cbfac48063ad29a01143c.zip
replace modulus with FastMod
Replaces the slow modulo operation with a much faster 32bit multiplication & shift. This works because the hash should be uniformly distributed between 0 and 2^32-1. This speeds up the benchmark by a factor of about 1.3: RollingBloom, 5, 1500000, 3.73733, 4.97569e-07, 4.99002e-07, 4.98372e-07 # before RollingBloom, 5, 1500000, 2.86842, 3.81630e-07, 3.83730e-07, 3.82473e-07 # FastMod Be aware that this changes the position of the bits that are toggled, so this should probably not be used for CBloomFilter which is serialized.
Diffstat (limited to 'src/httpserver.cpp')
0 files changed, 0 insertions, 0 deletions