Update the benchmarks on the sagemath website?

86 views
Skip to first unread message

SL

unread,
Feb 14, 2015, 7:04:27 AM2/14/15
to sage-s...@googlegroups.com
Hello,

The page at http://sagemath.org/tour-benchmarks.html is a bit outdated (and it also
has some typos).  Maybe it's time to update the website with a more recent
version...

I did some benchmarks of my own.  Here's the system information

:~ > lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 42
Stepping:              7
CPU MHz:               1600.000
BogoMIPS:              6784.31
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-7


######################################################################
sage: version()
'Sage Version 6.5.rc3, Release Date: 2015-02-13'


sage: a1 = 12345^678900 - 1
sage: a2 = 67890^123456 - 1
sage: len(str(a1))
2777714
sage: len(str(a2))
596516
sage: %timeit a1*a2
10 loops, best of 3: 27.9 ms per loop


sage: time a = factorial(10000000)
CPU times: user 2.7 s, sys: 76 ms, total: 2.78 s
Wall time: 2.79 s


sage: time a = factor(2^512 - 1)
CPU times: user 15.8 s, sys: 0 ns, total: 15.8 s
Wall time: 15.9 s


sage: %time _ = bernoulli(3*10^5)
CPU times: user 22.4 s, sys: 8 ms, total: 22.4 s
Wall time: 22.5 s
BernoulliB[3*10^5]


sage: time a = N(pi, digits=5000000)
CPU times: user 10.4 s, sys: 4 ms, total: 10.4 s
Wall time: 10.4 s

#Using mpmath
sage: from sage.libs.mpmath.all import pi as p
sage: time a = p(dps=5000000)
CPU times: user 5.02 s, sys: 12 ms, total: 5.03 s
Wall time: 5.02 s


sage: time a = is_pseudoprime(2^19937 - 1)
CPU times: user 1.87 s, sys: 0 ns, total: 1.87 s
Wall time: 1.87 s


sage: R.<a1,a2,a3,a4,a5,a6,a7> = QQ[]
sage: time f = (a1+a2+a3+a4+a5+a6+a7)^25
CPU times: user 472 ms, sys: 24 ms, total: 496 ms
Wall time: 498 ms

#In the symbolic ring
sage: (a1, a2, a3, a4, a5, a6, a7)
(a1, a2, a3, a4, a5, a6, a7)
sage: time f = expand((a1+a2+a3+a4+a5+a6+a7)^25)
CPU times: user 4.29 s, sys: 120 ms, total: 4.41 s
Wall time: 4.43 s


sage: R.<x,y,z> = PolynomialRing(GF(13))
sage: time _ = expand((x+y+z+1)**100)
CPU times: user 28 ms, sys: 0 ns, total: 28 ms
Wall time: 28.3 ms


sage: m1 = random_matrix(GF(2), 1000, 1000)
sage: m2 = random_matrix(GF(2), 1000, 1000)
sage: %timeit m1*m2
1000 loops, best of 3: 1.03 ms per loop
sage: %timeit m1+m2
10000 loops, best of 3: 23 µs per loop


sage: a = random_matrix(RDF,2000)
sage: timeit('a*a')
5 loops, best of 3: 404 ms per loop


sage: m = random_matrix(RDF, 1000)
sage: %time U,s,Vh = m.SVD()
CPU times: user 3.32 s, sys: 760 ms, total: 4.08 s
Wall time: 1.13 s

######################################################################
In[1]:= $Version
Out[1]= 10.0 for Linux x86 (64-bit) (December 4, 2014)


In[2]:= a1 = 12345^678900 - 1;
In[3]:= a2 = 67890^123456 - 1;
In[4]:= Timing[a1*a2][[1]]
Out[4]= 0.032002


In[5]:= Timing[10000000!][[1]]
Out[5]= 3.280205


In[6]:= Timing[FactorInteger[2^512 - 1]][[1]]
Out[6]= 70.412401


In[7]:= Timing[BernoulliB[3*10^5]][[1]]
Out[7]= 20.213263


In[8]:= Timing[N[Pi, 5000000]][[1]]
Out[8]= 2.256141


In[9]:= Timing[PrimeQ[2^19937 - 1]][[1]]
Out[9]= 4.904307


In[10]:= Timing[Expand[(a1+a2+a3+a4+a5+a6+a7)^25]][[1]]
Out[10]= 2.104131


In[11]:= Timing[Expand[(x+y+z+1)^100, Modulus -> 13]][[1]]
Out[11]= 0.112007


In[12]:= m1 := RandomInteger[{0,1},{1000, 1000}]
In[13]:= m2 := RandomInteger[{0,1},{1000, 1000}]
In[14]:= Timing[Mod[m1.m2, 2]][[1]]
Out[14]= 0.184012
In[15]:= Timing[Mod[m1+m2, 2]][[1]]
Out[15]= 0.036002


In[16]:= b = Table[
          RandomReal[
           UniformDistribution[{0, 1}]],
             {2000}, {2000}];
In[17]:= Timing[b . b][[1]]
Out[17]= 1.500094

Harald Schilly

unread,
Feb 14, 2015, 7:09:17 AM2/14/15
to sage-s...@googlegroups.com


On Saturday, February 14, 2015 at 1:04:27 PM UTC+1, SL wrote:
Hello,

The page at http://sagemath.org/tour-benchmarks.html is a bit outdated 


Sure, years ago I thought it is neat to have a small page with some benchmarks ;-)

The sources are here:

I'm not sure if I have time to work on this soon, contributions are welcome!

-- harald

SL

unread,
Feb 25, 2015, 2:39:38 AM2/25/15
to sage-s...@googlegroups.com
Maybe it would be good to use some tool like

https://github.com/tobami/codespeed/

to automatically track the timings.
Reply all
Reply to author
Forward
0 new messages