#13170: Speedup the default nonzero test for matrices
-------------------------------+--------------------------------------------
Reporter: SimonKing | Owner: tbd
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.2
Component: performance | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Simon King | Merged in:
Dependencies: | Stopgaps:
-------------------------------+--------------------------------------------
Changes (by SimonKing):
* status: new => needs_review
Comment:
With the patch, the timings become
{{{
sage: K = GF(2)
sage: M = random_matrix(K,1000,1000)
sage: %timeit bool(M)
625 loops, best of 3: 547 ns per loop
sage: M*=0
sage: %timeit bool(M)
25 loops, best of 3: 38 ms per loop
sage: K = GF(3)
sage: M = random_matrix(K,1000,1000)
sage: %timeit bool(M)
625 loops, best of 3: 464 ns per loop
sage: M*=0
sage: %timeit bool(M)
125 loops, best of 3: 3.61 ms per loop
sage: K = GF(4,'z')
sage: M = random_matrix(K,1000,1000)
sage: %timeit bool(M)
625 loops, best of 3: 665 ns per loop
sage: M*=0
sage: %timeit bool(M)
5 loops, best of 3: 67.9 ms per loop
sage: K = GF(25,'z')
sage: M = random_matrix(K,1000,1000)
sage: %timeit bool(M)
625 loops, best of 3: 504 ns per loop
sage: M*=0
sage: %timeit bool(M)
25 loops, best of 3: 38.6 ms per loop
sage: K.<x,y> = QQ[]
sage: M = random_matrix(K,100,100)
sage: %timeit bool(M)
625 loops, best of 3: 500 ns per loop
sage: M*=0
sage: %timeit bool(M)
625 loops, best of 3: 398 µs per loop
}}}
The speed-up is clear, though not as good as expected. Anyway: Needs
review!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13170#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.