#17561: Declare types in free_module_element
----------------------------------+------------------------
       Reporter:  jdemeyer        |        Owner:
           Type:  enhancement     |       Status:  new
       Priority:  minor           |    Milestone:  sage-6.5
      Component:  performance     |   Resolution:
       Keywords:                  |    Merged in:
        Authors:  Jeroen Demeyer  |    Reviewers:
Report Upstream:  N/A             |  Work issues:
         Branch:                  |       Commit:
   Dependencies:                  |     Stopgaps:
----------------------------------+------------------------
Description changed by jdemeyer:

Old description:



New description:

 We should declare the types `_entries` in `free_module_element.pxd`. This
 leads to a significant speed-up in the sparse case, and a minor speedup in
 the dense case:

 Before:
 {{{
 sage: v = vector(RR, range(10000)); timeit('v._add_(v)', repeat=10,
 number=1000)
 1000 loops, best of 10: 1.85 ms per loop
 sage: v = vector(RR, range(10000), sparse=True); timeit('v._add_(v)',
 repeat=10, number=1000)
 1000 loops, best of 10: 3.49 ms per loop
 }}}

 After:
 {{{
 sage: v = vector(RR, range(10000)); timeit('v._add_(v)', repeat=10,
 number=1000)
 1000 loops, best of 10: 1.82 ms per loop
 sage: v = vector(RR, range(10000), sparse=True); timeit('v._add_(v)',
 repeat=10, number=1000)
 1000 loops, best of 10: 2.85 ms per loop
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/17561#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 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/d/optout.

Reply via email to