File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,13 @@ static void RollingBloom(benchmark::State& state)
28
28
}
29
29
}
30
30
31
+ static void RollingBloomReset (benchmark::State& state)
32
+ {
33
+ CRollingBloomFilter filter (120000 , 0.000001 );
34
+ while (state.KeepRunning ()) {
35
+ filter.reset ();
36
+ }
37
+ }
38
+
31
39
BENCHMARK (RollingBloom, 1500 * 1000 );
40
+ BENCHMARK (RollingBloomReset, 20000 );
Original file line number Diff line number Diff line change 14
14
#include < math.h>
15
15
#include < stdlib.h>
16
16
17
+ #include < algorithm>
17
18
18
19
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
19
20
#define LN2 0.6931471805599453094172321214581765680755001343602552
@@ -304,7 +305,5 @@ void CRollingBloomFilter::reset()
304
305
nTweak = GetRand (std::numeric_limits<unsigned int >::max ());
305
306
nEntriesThisGeneration = 0 ;
306
307
nGeneration = 1 ;
307
- for (std::vector<uint64_t >::iterator it = data.begin (); it != data.end (); it++) {
308
- *it = 0 ;
309
- }
308
+ std::fill (data.begin (), data.end (), 0 );
310
309
}
You can’t perform that action at this time.
0 commit comments