<div dir="auto">Okay :)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El sáb., 12 oct. 2019 1:47 a. m., Andres Valloud via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, how about we ship off the 8281 boundary code then?<br>
<br>
On 10/11/19 20:36, Agustín Sansone via Cuis-dev wrote:<br>
> This ir what I get:<br>
> <br>
> "3970 boundary"<br>
> Time millisecondsToRun: [10000 timesRepeat: [1 to: 8281 by: 8 do: [:x |x <br>
> isPrimeFast]]]. 5257<br>
> <br>
> "8281 boundary"<br>
> Time millisecondsToRun: [10000 timesRepeat: [1 to: 8281 by: 8 do: [:x |x <br>
> isPrimeFast2]]]. 4104<br>
> <br>
> El sáb., 12 oct. 2019 a las 0:02, Andres Valloud via Cuis-dev <br>
> (<<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a>>>) escribió:<br>
> <br>
> I think this happened because we are measuring against different number<br>
> sets so we ended up tuning to our tests. By the way, I'm having some<br>
> trouble getting reliable times, the figures seem to change by ~10%<br>
> without any obvious reason. For instance, for the last code you sent,<br>
> running that through some of the tests here results in times ranging<br>
> from 2272 to 2510 milliseconds --- and that's starting from a clean<br>
> system after a GC, so each run starts in the same conditions. That's a<br>
> lot of difference for a computer that should be roughly stable...<br>
> <br>
> Would you mind checking the numbers you get with the attached method?<br>
> It just takes your latest code and increases the boundary for the small<br>
> number loop to 8281. Here's why I'd like to see what happens for you:<br>
> <br>
> "your latest"<br>
> Time millisecondsToRun: [10000 timesRepeat: [1 to: 8281 by: 8 do: [:x |<br>
> x isPrimeFast1c]]] 1647<br>
> <br>
> "attached here"<br>
> Time millisecondsToRun: [10000 timesRepeat: [1 to: 8281 by: 8 do: [:x |<br>
> x isPrimeFast1d]]] 1565<br>
> <br>
> Andres.<br>
> <br>
> On 10/11/19 10:59, Agustín Sansone via Cuis-dev wrote:<br>
> > Latest code you sent:<br>
> > Time millisecondsToRun:<br>
> > [1 to: 10000000 do: [:e | e isPrimeFast]]. 16025<br>
> ><br>
> > Latest code I sent:<br>
> > Time millisecondsToRun:<br>
> > [1 to: 10000000 do: [:e | e isPrimeFast]]. 14435<br>
> ><br>
> ><br>
> > El vie., 11 oct. 2019 a las 2:09, Andres Valloud via Cuis-dev<br>
> > (<<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a>><br>
> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a>>>>)<br>
> escribió:<br>
> ><br>
> > Euclid's gcd algorithm converges to the answer exponentially<br>
> with base<br>
> > phi. Larger small integers help amortize the extra cost.<br>
> ><br>
> > On 10/10/19 21:53, Phil B wrote:<br>
> > > Was that primarily due to the 64-bit version mostly<br>
> fitting within<br>
> > > SmallInteger? I find many numeric performance issues just<br>
> melt<br>
> > away by<br>
> > > staying away from Large*Integer (and Fraction)... they're<br>
> great for<br>
> > > maintaining accuracy, lousy for performance. As in<br>
> multiples to<br>
> > orders<br>
> > > of magnitude worse depending on what you're doing.<br>
> > ><br>
> > > On Fri, Oct 11, 2019 at 12:40 AM Andres Valloud via Cuis-dev<br>
> > > <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a>><br>
> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a>>><br>
> > <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a><br>
> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a>> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a><br>
> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">cuis-dev@lists.cuis.st</a>>>>> wrote:<br>
> > ><br>
> > > Fascinating --- the gcd approach was pretty bad in 32<br>
> bit land.<br>
> > > However, in 64 bits, the gcd batches are large enough to<br>
> > amortize the<br>
> > > cost, and that detects most composites without sending<br>
> > sqrtFloor. The<br>
> > > small integer threshold is now 91 squared.<br>
> > ><br>
> > > On 10/10/19 20:37, Agustín Sansone via Cuis-dev wrote:<br>
> > > > Well, what do you think? Are we done going<br>
> over this poor<br>
> > > method?<br>
> > > ><br>
> > > ><br>
> > > > Okay, I'm happy with this version.<br>
> > > ><br>
> > > --<br>
> > > Cuis-dev mailing list<br>
> > > <a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a>><br>
> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a>>><br>
> > <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a>> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a>>>><br>
> > > <a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
> > ><br>
> > --<br>
> > Cuis-dev mailing list<br>
> > <a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a>><br>
> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a>>><br>
> > <a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
> ><br>
> ><br>
> -- <br>
> Cuis-dev mailing list<br>
> <a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a>><br>
> <a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
> <br>
> <br>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>