#15104: Special case modn_dense matrix operations to improve performance
-------------------------------------+-------------------------------------
       Reporter:  nbruin             |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.2
      Component:  linear algebra     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Nils Bruin         |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/nbruin/ticket/15104              |  a908e28159a544ca33f03dcbf0e8def3cfe9a60e
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 OK, I think I changed all the places where a new matrix is created. I
 think there's room for even further optimization by someone who
 understands the intricacies of matrix creation a little better. I'm now
 getting significantly better timings again. With the new branch:
 {{{
 sage: k=GF(17)
 sage: n=20
 sage: m=30
 sage: M=matrix(k,n,m,[k.random_element() for j in range(n*m)])
 sage: %timeit M.right_kernel_matrix(basis='computed')
 10000 loops, best of 3: 88.2 us per loop
 sage: %timeit M.right_kernel_matrix(basis='pivot')
 10000 loops, best of 3: 91.5 us per loop
 sage: %timeit M.transpose()
 100000 loops, best of 3: 13.7 us per loop
 sage: %timeit M.stack(M)
 10000 loops, best of 3: 19.3 us per loop
 sage: %timeit M.submatrix(1,1)
 100000 loops, best of 3: 14.1 us per loop
 sage: %timeit M.submatrix(3,nrows=5)
 100000 loops, best of 3: 14 us per loop
 }}}
 On vanilla 6.0:
 {{{
 sage: k=GF(17)
 sage: n=20
 sage: m=30
 sage: M=matrix(k,n,m,[k.random_element() for j in range(n*m)])
 sage: %timeit M.right_kernel_matrix(basis='computed')
 10000 loops, best of 3: 141 us per loop
 sage: %timeit M.right_kernel_matrix(basis='pivot')
 10000 loops, best of 3: 143 us per loop
 sage: %timeit M.transpose()
 10000 loops, best of 3: 22.2 us per loop
 sage: %timeit M.stack(M)
 10000 loops, best of 3: 50.3 us per loop
 sage: %timeit M.submatrix(1,1)
 10000 loops, best of 3: 37.1 us per loop
 sage: %timeit M.submatrix(3,nrows=5)
 10000 loops, best of 3: 22.3 us per loop
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/15104#comment:10>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to