Differences between revisions 2 and 3
 ⇤ ← Revision 2 as of 2009-04-09 03:04:35 → Size: 435 Editor: was Comment: ← Revision 3 as of 2009-04-09 03:10:56 → ⇥ Size: 1933 Editor: was Comment: Deletions are marked like this. Additions are marked like this. Line 3: Line 3: * Large degree polynomial multiplication modulo n: * Large degree polynomial multiplication modulo n (sage is twice as fast): Line 5: Line 5: sage: R. = Zmod(next_prime(8000^3))[]sage: ff = R.random_element(degree=3200)sage: time v = [ff*ff for i in [1..100]] [[email protected]]\$ ~/eno/build/sage-3.4.alpha0/sage----------------------------------------------------------------------| Sage Version 3.4.alpha0, Release Date: 2009-02-24 || Type notebook() for the GUI, and license() for information. |----------------------------------------------------------------------sage: magma.version()((2, 15, 5), 'V2.15-5')sage: sage: R. = Zmod(next_prime(8000^3))[]sage: sage: ff = R.random_element(degree=3200)sage: sage: time v = [ff*ff for i in [1..100]]CPU times: user 0.26 s, sys: 0.00 s, total: 0.26 sWall time: 0.27 ssage: sage: sage: S = magma(R)sage: sage: f = magma('%s![Random(0,10000000) : i in [1..3200]]'%S.name())sage: sage: magma.eval('time z:=[%s*%s : i in [1..100]]'%(f.name(), f.name()))'Time: 0.560' Line 10: Line 24: * Computing factorials (Magma takes 50% longer). Line 11: Line 26: sage: S = magma(R)sage: f = magma('%s![Random(0,10000000) : i in [1..3200]]'%S.name())sage: magma.eval('time z:=[%s*%s : i in [1..100]]'%(f.name(), f.name())) [[email protected]]\$ ~/eno/build/sage-3.4.alpha0/sage----------------------------------------------------------------------| Sage Version 3.4.alpha0, Release Date: 2009-02-24 || Type notebook() for the GUI, and license() for information. |----------------------------------------------------------------------sage: magma.version()((2, 15, 5), 'V2.15-5')sage: time n = factorial(10^6)CPU times: user 0.94 s, sys: 0.02 s, total: 0.96 sWall time: 0.98 ssage: time magma.eval('time n := Factorial(10^6);')CPU times: user 0.00 s, sys: 0.02 s, total: 0.02 sWall time: 2.95 s'Time: 1.440'sage: time magma.eval('time n := Factorial(10^7);')CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 sWall time: 27.88 s'Time: 27.340'sage: time n = factorial(10^7)CPU times: user 18.60 s, sys: 0.17 s, total: 18.76 sWall time: 19.11 ssage: 27.34/18.761.45735607675906

# List of Computations where Sage is Noticeably Faster than Magma

* Large degree polynomial multiplication modulo n (sage is twice as fast):

```[[email protected]]\$ ~/eno/build/sage-3.4.alpha0/sage
----------------------------------------------------------------------
| Sage Version 3.4.alpha0, Release Date: 2009-02-24                  |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: magma.version()
((2, 15, 5), 'V2.15-5')
sage: sage: R.<t> = Zmod(next_prime(8000^3))[]
sage: sage: ff = R.random_element(degree=3200)
sage: sage: time v = [ff*ff for i in [1..100]]
CPU times: user 0.26 s, sys: 0.00 s, total: 0.26 s
Wall time: 0.27 s
sage:
sage: sage: S = magma(R)
sage: sage: f = magma('%s![Random(0,10000000) : i in [1..3200]]'%S.name())
sage: sage: magma.eval('time z:=[%s*%s : i in [1..100]]'%(f.name(), f.name()))
'Time: 0.560'```

* Computing factorials (Magma takes 50% longer).

```[[email protected]]\$ ~/eno/build/sage-3.4.alpha0/sage
----------------------------------------------------------------------
| Sage Version 3.4.alpha0, Release Date: 2009-02-24                  |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: magma.version()
((2, 15, 5), 'V2.15-5')
sage: time n = factorial(10^6)
CPU times: user 0.94 s, sys: 0.02 s, total: 0.96 s
Wall time: 0.98 s
sage: time magma.eval('time n := Factorial(10^6);')
CPU times: user 0.00 s, sys: 0.02 s, total: 0.02 s
Wall time: 2.95 s
'Time: 1.440'
sage: time magma.eval('time n := Factorial(10^7);')
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 27.88 s
'Time: 27.340'
sage: time n = factorial(10^7)
CPU times: user 18.60 s, sys: 0.17 s, total: 18.76 s
Wall time: 19.11 s
sage: 27.34/18.76
1.45735607675906```

sagebeatsmagma (last edited 2009-06-12 09:39:03 by was)