Thread: Octoproths
View Single Post
Old 2006-01-12, 23:17   #236
R. Gerbicz
R. Gerbicz's Avatar
"Robert Gerbicz"
Oct 2005

26428 Posts

Originally Posted by Kosmaj
But how can we know when to use 4.3 and when 4.5 so that we don't waste any time? Since the difference between the two versions is very small I still think that a command-line switch is a better way to handle them (instead having two executables).
To give a quick check. I suggest that run the two versions up to 0.2% and write down the timings: Say for the same n value and Range you'll get:
version4.3 0.1% 40 sec.
0.2% 81 sec.
version4.5 0.1% 35 sec.
0.2% 69 sec.
Then version 4.5 is faster for this n value and range, and you've wasted only about 0.4% of the total sieving time, but using 4.5 instead of 4.3 You'll get a speedup by 14%

Note that the percentage is only an approx value, but if your Range is large, say 10^13, then it is a very good approximation.

Note that it is dependent on n and Range which program is faster, not only on Range! And it is very important that not run other programs or tasks on your computer when you test these two programs, otherwise you'll get false timings.
R. Gerbicz is offline