On Jul 9, 2009, at 2:32 AM, Dr. David Kirkby wrote: > There was some discussion a month or two back about different > algorithms > for prime_pi. IIRC, Mathematica's was the fastest, Sage's was second > fastest and Maple's method was dumb and just counted them like a 10 > year > old could do.
I believe the fastest was some code sitting on Victor Miller's laptop, which blew Mathematica away, but I don't think that's hit Sage (or production) anywhere yet. > I pointed out a link to those with accounts on sage.math.users of a > discussion on the newsgroup comp.unix.solaris about how to get maximum > performance from a Sun T5240 (the same machine as 't2'). It was > quite a > technical discussion about why old machines can be faster or slower, > depending how the program is written. Someone wrote a program which > computed the primes under 10,000 in C, and compared the speed of > his old > machine to his high spec Sun T5240 and showed the old machine was > quicker. > > (BTW, 't2' has 16 cores and 128 virtual processors) > > A Sun employee, Andrew Gabriel, who I happen to know, then re-wrote > the > program for him in a way to exploit the Sun T5240 properly. William > re-run the program yesterday and found the time drop from 21 > seconds to > 0.6 seconds when he used 128 threads. Yes, that was quite surprising. > It then occurred to me that perhaps Maple's dumb method of computing > number of primes under n might be silly on most machines, but might if > re-written to use a parallel machine properly, it could be the most > sensible way to do it. Actually, the clever algorithm is very parallelizable, so you could have the best of both worlds. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---