![]() |
|
|
#12 | |
|
"William"
May 2003
New Haven
93E16 Posts |
Quote:
Cheesehead and George's remarks implemented simplistically and limited to "3" could be 3 arrays of 1/3 length, of which you only need to keep 2, so they can be longer. Alternatively, two passes through the array at step size 3q would eliminate the multiples of q that were not already multiples of 3, hitting only 2/3 as many points - is the extra pass more expensive than 50% more marking? I don't really know - but it seems there really should be an efficiency from algorithmically avoiding the 3's. William |
|
|
|
|
|
|
#13 | |
|
P90 years forever!
Aug 2002
Yeehaw, FL
19·397 Posts |
Quote:
When I optimized the sieve ages ago (probably on a PII or PIII) I inserted a premature end-of-table until I got the best timings. The best timings definitely came well before building a full list of all primes up to 64K. If I recall correctly, sieving was about 5% of total time. |
|
|
|
|
|
|
#14 |
|
Tribal Bullet
Oct 2004
3×1,181 Posts |
If there are many large primes to sieve with, and their average size greatly exceeds the sieve size, then perhaps you can divide the sieve into blocks and drop sieve updates into buckets that are each one block wide. Sieving proceeds in two passes, the first to fill the buckets and the second to move updates from the buckets to the sieve array. When one bucket is processed, the primes in that bucket all scatter to their 'next bucket' individually. Perhaps that could be a cheap way of artificially increasing the sieve size, and would change the balance of where runtime goes.
Of course George already implemented this optimization in Bob Silverman's lattice siever, so if it would help Prime95's trial factoring then he probably would have coded it there too. 'Bucket sorting' is starting to become a reflex with me... Last fiddled with by jasonp on 2009-04-07 at 03:33 |
|
|
|
|
|
#15 | |
|
"Richard B. Woods"
Aug 2002
Wisconsin USA
11110000011002 Posts |
Quote:
Mod 120 with 3-or-5 mod 8 excluded leaves congruence classes 1, 7, 17, 23, 31, 41, 47, 49 and the corresponding reflections above 60, for the 16 total. Last fiddled with by cheesehead on 2009-04-07 at 05:43 |
|
|
|
|
|
|
#16 | |
|
Jul 2006
Calgary
52·17 Posts |
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Constructing a sieve for trial factors | davieddy | Math | 48 | 2009-07-07 19:42 |
| How far to do trial factoring | S485122 | PrimeNet | 1 | 2007-09-06 00:52 |
| trial factoring and P-1 | jocelynl | Math | 8 | 2006-02-01 14:12 |
| How to only do Trial Factoring? | michael | Software | 23 | 2004-01-06 08:54 |
| About trial factoring | gbvalor | Math | 4 | 2003-05-22 02:04 |