On Sun, Aug 23, 2009 at 1:29 AM, Harald Schilly<harald.schi...@gmail.com> wrote:
>
> On Aug 23, 12:24 am, Simon King <simon.k...@nuigalway.ie> wrote:
>>
>> So, over QQ, MMA is slightly faster, but over finite fields Sage
>> clearly wins? That is already something worth pointing out.
>>
>
> I'm not a mma expert, but since they have no system in place to define
> the ring it's noteworthy to stick the finger where it hurts ... Here
> is another very simple one: multiply and add random boolean matrices:
>
> sage: m1 = random_matrix(GF(2), 1000, 1000)
> sage: m2 = random_matrix(GF(2), 1000, 1000)
> sage: %timeit 'm1 * m2'
> 10000000 loops, best of 3: 31.2 ns per loop
> sage: %timeit 'm1 + m2'
> 10000000 loops, best of 3: 31.2 ns per loop

This is wrong; %timeit 'm1 + m2' measures the time evaluating the
string 'm1 + m2' (i.e. basically the dummy overhead in the Python
interpreter). I don't think Sage is quite *that* fast :-)

On sage.math I get:

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

Fredrik

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to