-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf8e09f
commit 87be58a
Showing
2 changed files
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/// @file ParallelSieve.cpp | ||
/// @brief Multi-threaded prime sieve using std::async. | ||
/// | ||
/// Copyright (C) 2023 Kim Walisch, <[email protected]> | ||
/// Copyright (C) 2024 Kim Walisch, <[email protected]> | ||
/// | ||
/// This file is distributed under the BSD License. See the COPYING | ||
/// file in the top level directory. | ||
|
@@ -83,7 +83,7 @@ uint64_t ParallelSieve::getThreadDistance(int threads) const | |
ASSERT(getDistance() > 0); | ||
|
||
uint64_t dist = getDistance(); | ||
uint64_t balanced = isqrt(stop_) * 1000; | ||
uint64_t balanced = isqrt(stop_) * 200; | ||
uint64_t unbalanced = dist / threads; | ||
uint64_t fastest = std::min(balanced, unbalanced); | ||
uint64_t iters = dist / fastest; | ||
|