@@ -60,7 +60,8 @@ BOOST_AUTO_TEST_CASE(test_cuckoocache_no_fakes)
60
60
{
61
61
insecure_rand = FastRandomContext (true );
62
62
CuckooCache::cache<uint256, uint256Hasher> cc{};
63
- cc.setup_bytes (32 << 20 );
63
+ size_t megabytes = 4 ;
64
+ cc.setup_bytes (megabytes << 20 );
64
65
uint256 v;
65
66
for (int x = 0 ; x < 100000 ; ++x) {
66
67
insecure_GetRandHash (v);
@@ -135,7 +136,7 @@ BOOST_AUTO_TEST_CASE(cuckoocache_hit_rate_ok)
135
136
* as a lower bound on performance.
136
137
*/
137
138
double HitRateThresh = 0.98 ;
138
- size_t megabytes = 32 ;
139
+ size_t megabytes = 4 ;
139
140
for (double load = 0.1 ; load < 2 ; load *= 2 ) {
140
141
double hits = test_cache<CuckooCache::cache<uint256, uint256Hasher>>(megabytes, load);
141
142
BOOST_CHECK (normalize_hit_rate (hits, load) > HitRateThresh);
@@ -204,7 +205,7 @@ void test_cache_erase(size_t megabytes)
204
205
205
206
BOOST_AUTO_TEST_CASE (cuckoocache_erase_ok)
206
207
{
207
- size_t megabytes = 32 ;
208
+ size_t megabytes = 4 ;
208
209
test_cache_erase<CuckooCache::cache<uint256, uint256Hasher>>(megabytes);
209
210
}
210
211
@@ -291,7 +292,7 @@ void test_cache_erase_parallel(size_t megabytes)
291
292
}
292
293
BOOST_AUTO_TEST_CASE (cuckoocache_erase_parallel_ok)
293
294
{
294
- size_t megabytes = 32 ;
295
+ size_t megabytes = 4 ;
295
296
test_cache_erase_parallel<CuckooCache::cache<uint256, uint256Hasher>>(megabytes);
296
297
}
297
298
@@ -342,13 +343,13 @@ void test_cache_generations()
342
343
}
343
344
};
344
345
345
- const uint32_t BLOCK_SIZE = 10000 ;
346
+ const uint32_t BLOCK_SIZE = 1000 ;
346
347
// We expect window size 60 to perform reasonably given that each epoch
347
348
// stores 45% of the cache size (~472k).
348
349
const uint32_t WINDOW_SIZE = 60 ;
349
350
const uint32_t POP_AMOUNT = (BLOCK_SIZE / WINDOW_SIZE) / 2 ;
350
351
const double load = 10 ;
351
- const size_t megabytes = 32 ;
352
+ const size_t megabytes = 4 ;
352
353
const size_t bytes = megabytes * (1 << 20 );
353
354
const uint32_t n_insert = static_cast <uint32_t >(load * (bytes / sizeof (uint256)));
354
355
0 commit comments