#4982: consolidate shifts in polynomial_template
---------------------------+------------------------------------------------
   Reporter:  robertwb     |       Owner:  tbd         
       Type:  enhancement  |      Status:  needs_review
   Priority:  major        |   Milestone:  sage-4.3    
  Component:  algebra      |    Keywords:              
Work_issues:               |      Author:  Alex Ghitza 
   Reviewer:               |      Merged:              
---------------------------+------------------------------------------------

Comment(by malb):

 Alex and I were discussing this off-list. The speedup patch does the
 following:

  * added a new C function which all methods call now
  * I inlined it
  * and I changed the code to avoid some initialisation

 Here is what I got:

 '''Vanilla:'''
 {{{
 sage: P.<x> = GF(2)[]
 sage: f = P.random_element(50)
 sage: %timeit f<<50
 1000000 loops, best of 3: 730 ns per loop
 }}}

 '''Patch:'''
 {{{
 sage: P.<x> = GF(2)[]
 sage: f = P.random_element(50)
 sage: %timeit f<<50
 1000000 loops, best of 3: 1.06 µs per loop
 }}}

 '''Patch + Speed-up:'''
 {{{
 sage: P.<x> = GF(2)[]
 sage: %timeit f<<50
 1000000 loops, best of 3: 761 ns per loop
 }}}

 So there is still some overhead, but I think its acceptable.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4982#comment:7>
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=.


Reply via email to