diff --git a/implementations/caching/cache/Cache.h b/implementations/caching/cache/Cache.h index 89cef733..37bf2ef0 100644 --- a/implementations/caching/cache/Cache.h +++ b/implementations/caching/cache/Cache.h @@ -126,7 +126,8 @@ void Cache::_deleteOldEntriesParallel() { template void Cache::_deleteMatchingEntriesAtBeginningParallel(std::function &)> matches) { - unsigned int numThreads = std::max(1u, std::thread::hardware_concurrency()); + // Twice the number of cores, so we use full CPU even if half the threads are doing I/O + unsigned int numThreads = 2 * std::max(1u, std::thread::hardware_concurrency()); std::vector> waitHandles; for (unsigned int i = 0; i < numThreads; ++i) { waitHandles.push_back(std::async(std::launch::async, [this, matches] {