On Sat, Aug 22, 2009 at 2:08 PM, Dr. David Kirkby <david.kir...@onetel.net>wrote:
> > William Stein wrote: > > > > > > On Sat, Aug 22, 2009 at 10:48 AM, Dr. David Kirkby > > <david.kir...@onetel.net <mailto:david.kir...@onetel.net>> wrote: > > > > > > Dr. David Kirkby wrote: > > > Has anyone ever thought of developing a Sage benchmark, so > allowing > > > different hardware to be compared in running Sage? If people are > > setting > > > up a Sage server, it would be sensible they have some idea of the > > > performance of various hardware. > > > > > > Mathematica has one built in, which tests 15 things. > > > I got a reply from Karl Unterkofler who has developed that > Mathematica > > benchmark which appears to be quite widely used. > > > > > > http://www2.staff.fh-vorarlberg.ac.at/~ku/karl/mma.html<http://www2.staff.fh-vorarlberg.ac.at/%7Eku/karl/mma.html> > > <http://www2.staff.fh-vorarlberg.ac.at/%7Eku/karl/mma.html> > > > > He has no problem if we wanted to adapt his benchmark for Sage, > though > > he would appreciate a reference to the original source. > > > > You can see what his latest version does here: > > > > http://www2.staff.fh-vorarlberg.ac.at/~ku/karl/timings70.html<http://www2.staff.fh-vorarlberg.ac.at/%7Eku/karl/timings70.html> > > <http://www2.staff.fh-vorarlberg.ac.at/%7Eku/karl/timings70.html> > > > > > > 1. Timing[N[Pi, 5000000]]][[1]] > > 2. Timing[N[Sin[1/2], 3000000]][[1]] > > 3. Timing[10000000!][[1]] > > 4. Timing[FactorInteger[2^256 - 1]][[1]] > > 5. Timing[PrimeQ[2^19937 - 1]][[1]] > > > > > > Here are the first 5 and number 17: > > I think you mean the first five and number 13 - there are only 15 tests. > > > time a = N(pi, 5000000) > > time a = N(sin(1/2), 3000000) > > time a = factorial(10000000) > > time a = factor(2^256 - 1) > > time a = is_prime(2^19937 - 1) > > > > # test 17: > > sage: R.<a1,a2,a3,a4,a5,a6,a7> = QQ[] > > sage: time f=(a1 + a2 + a3 + a4 + a5 + a6 + a7)^29 > > CPU times: user 26.90 s, sys: 1.20 s, total: 28.10 s > > Wall time: 34.55 s > > > > If this is a widely used benchmark, Mathematica may have been tuned by > > Wolfram Inc to do well on these problems, so it might be worth varying > > some parameters. > > Yes, I did consider that. > > Although prior to the 22nd August 2009 Wolfram Research had little if > anything to gain by making any particular test faster, since the > benchmark is currently only used with Mathematica. Neither Karl, nor > anyone else i am aware of (prior to you) have re-written it for MATLAB, > Maple or any other similar software. > > Of course, if Sage used Karl's benchmark, Wolfram Research would have > something to gain by making the tests faster. That could lead to an > interesting 'cat and mouse' game! > > > > > On my laptop (OS X 64-bit Sage-4.1.1 and Mathematica 7.0): > > > > Test 1 -- sage (=mpfr) wins > > > > SAGE: > > sage: time a = N(pi, 5000000) > > CPU times: user 10.31 s, sys: 0.94 s, total: 11.26 s > > Wall time: 11.73 s > > There's quite a difference between 'total' and 'Wall time' Maybe I was listening to a CD, latexing a document, OS X was making a backup of my files, etc. For all the tests I did the wall time is not relevant. It is only worth looking at on a relatively unloaded system when doing the same test many times. > > MATHEMATICA: > > In[1]:= Timing[N[Pi, 5000000]]][[1]] > > Out[1]= 11.3116 > > Sage wins or loses here depending on whether you use Sage's 'total' time > or 'Wall time'. The MMA Timing[] command gives a result somewhere > between the two. Sage loses because I made a mistake of bits versus digits. Wall time is irrelevant. > > > > I checked and the docs for PrimeQ say it returns True if and only if the > > input number is prime. Been it points at the implementation notes, > > which describes the primality test they implement at it is only a > > pseudoprimality test. I.e., Mathematica's PrimeQ is really like Sage's > > is_pseudoprime, despite their very misleading docs. > > Yes, that is a big difference. I thought they had a function something > like 'ProbablyPrime[]' but perhaps not. There PrimeQ is just a probabilistic test, I think. > > > > > --------------------------- > > > > Test 17 -- expanding a symbolic expression: Sage = Singular is slightly > > slower > > > > sage: R.<a1,a2,a3,a4,a5,a6,a7> = QQ[] > > sage: time f=(a1 + a2 + a3 + a4 + a5 + a6 + a7)^29 > > CPU times: user 26.90 s, sys: 1.20 s, total: 28.10 s > > > > In[15]:= Timing[Expand[(a1 + a2 + a3 + a4 + a5 + a6 + a7)^29]][[1]] > > Out[15]= 24.2602 > > --------------------------- > > > > So Sage wins 4 out 6 of the benchmarks on my laptop at least (a new > > Macbook Air). > > > > -- William > > > If that whole thing could be implemented, it would make for interesting > results. Karl might even want to provide a link to Sage results! > Well I hope somebody convert them all. There aren't too many. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an 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 -~----------~----~----~----~------~----~------~--~---