mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Msieve

Reply
 
Thread Tools
Old 2014-05-15, 15:59   #23
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

66718 Posts
Default

Quote:
Originally Posted by mickfrancis View Post
I appreciate that people are more concerned with GNFS than SIQS, but I just thought I'd mention that I've got a speedup of around 6% (for C80, C90 and C100) by making the following change in sieve.c (conditional on __MDF__):

Code:
	/* choose the largest factor base prime that does not
	   use hashtables or reciprocals. We could make this
	   range empty, but it's better to start using hashtables
	   with primes somewhat larger than the block size.
	   This greatly reduces the amount of memory used by
	   the hashtables, and trial factoring by primes in this
	   range is extremely cheap */

	for (; i < fb_size && conf.factor_base[i].prime <
#if defined(__MDF__)
            sieve_block_size; i++) {
#else
            3 * sieve_block_size; i++) {
#endif
		/* nothing */
	}
I also tried using sieve_block_size/2, but that degrades performance. This is on an Intel i7-3770. Testing was after removing the PREFETCH in add_to_hashtable() in sieve_core.c, which may be important as that function will be more heavily loaded by this change if I'm not mistaken.

Cheers,

Mick.
I tried it out and it ran in exactly the same time on a C80 with this change. I'd expect this improvement to vary a lot more depending on the cpu/system, so this could be an isolated case. I'll try again with a larger number.

By the way, since it seems you are pretty gung-ho about siqs, feel free to look for optimizations in yafu as well .

It is between 1.5-2.5x faster than msieve now, so they may be harder to find, but the more eyes the merrier!

cheers,
- ben.
bsquared is offline   Reply With Quote
Old 2014-05-15, 16:52   #24
mickfrancis
 
Apr 2014
Marlow, UK

23·7 Posts
Default

Thanks Ben - it would be interesting to see if anyone else finds an improvement - it is 100% repeatable for me.

I do have a buildable yafu in NetBeans, but haven't had much of a look at that yet - it does seem fast, and it's great that it can multi-thread. I'm only a few weeks into learning about SIQS, so I'm using the goal of optimisation as a vehicle on the journey towards greater understanding of the theory and implementation techniques. Once I've got there, I'll start on the NFS, but there's a bit of an abstract algebra learning curve for me to climb first!

Cheers,

Mick.
mickfrancis is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Source code to mprime 289 out there somewhere? graysky Linux 6 2016-04-25 23:03
Source Code for msieve ? mohamed Msieve 8 2013-12-14 01:04
Source code for my program Sam Kennedy Factoring 7 2012-11-22 18:24
llrnet - source code? reezer Prime Sierpinski Project 11 2009-09-11 10:47
Support for other OSs on x86/source code reezer Software 1 2007-02-08 12:57

All times are UTC. The time now is 00:50.


Sat Jul 17 00:50:58 UTC 2021 up 49 days, 22:38, 1 user, load averages: 1.71, 1.56, 1.43

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.