[libmath-prime-util-perl] 04/13: Set smaller preseive with standalone primesieve
Partha P. Mukherjee
ppm-guest at moszumanska.debian.org
Thu May 21 18:47:41 UTC 2015
This is an automated email from the git hooks/post-receive script.
ppm-guest pushed a commit to annotated tag v0.24
in repository libmath-prime-util-perl.
commit b9cab41923fb996ac0f671b31d606a4872891a1d
Author: Dana Jacobsen <dana at acm.org>
Date: Thu Mar 7 13:38:11 2013 -0800
Set smaller preseive with standalone primesieve
---
lehmer.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lehmer.c b/lehmer.c
index 5d75415..bf52305 100644
--- a/lehmer.c
+++ b/lehmer.c
@@ -65,9 +65,9 @@
*/
static int const verbose = 0;
-/* #define STAGE_TIMING 1 */
+#define STAGE_TIMING 0
-#ifdef STAGE_TIMING
+#if STAGE_TIMING
#include <sys/time.h>
#define DECLARE_TIMING_VARIABLES struct timeval t0, t1;
#define TIMING_START gettimeofday(&t0, 0);
@@ -769,6 +769,9 @@ int main(int argc, char *argv[])
method = "lehmer";
gettimeofday(&t0, 0);
+
+ /* Using a smaller preseive speeds us up since our counts are usually small */
+ ps.setPreSieve(13);
SET_PPS_PARALLEL;
if (!strcasecmp(method, "lehmer")) { pi = _XS_lehmer_pi(n); }
else if (!strcasecmp(method, "meissel")) { pi = _XS_meissel_pi(n); }
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git
More information about the Pkg-perl-cvs-commits
mailing list