#11935: Make parent/element classes independent of base rings
-----------------------------------------------------------------+----------
       Reporter:  SimonKing                                      |         
Owner:              
           Type:  enhancement                                    |        
Status:  needs_review
       Priority:  major                                          |     
Milestone:  sage-5.0    
      Component:  categories                                     |    
Resolution:              
       Keywords:  parent class, element class, category          |   Work 
issues:              
Report Upstream:  N/A                                            |     
Reviewers:              
        Authors:  Simon King                                     |     Merged 
in:              
   Dependencies:  #9138, #11900, #11943, #12875, #12876, #12877  |      
Stopgaps:              
-----------------------------------------------------------------+----------

Comment (by SimonKing):

 Some other little speed-up:
 {{{
 sage: def test1(cls,name):
 ....:     s = "%s.%s"%(cls.__name__, name)
 ....:
 sage: def test2(cls,name):
 ....:     s = cls.__name__+'.'+name
 ....:
 sage: timeit("test1(ZZ.__class__,'element_class')", number=10000)
 10000 loops, best of 3: 2.15 µs per loop
 sage: timeit("test2(ZZ.__class__,'element_class')", number=10000)
 10000 loops, best of 3: 1.85 µs per loop
 }}}
 So, adding strings seems to be faster than inserting into a format string.

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

Reply via email to