#11342: Make getattr faster on parents and elements
---------------------------+------------------------------------------------
   Reporter:  SimonKing    |          Owner:                        
       Type:  enhancement  |         Status:  needs_review          
   Priority:  major        |      Milestone:  sage-4.7.1            
  Component:  performance  |       Keywords:  getattr parent element
Work_issues:               |       Upstream:  N/A                   
   Reviewer:               |         Author:  Simon King            
     Merged:               |   Dependencies:  #9944                 
---------------------------+------------------------------------------------
Changes (by hivert):

  * owner:  tbd =>


Comment:

 Hi Simon

 Some more info: According to prun most of the time is spend during the
 copy in
 {{{
     def __mod__(self, args):
         """
         """
         if hasattr(self, "_args"): # self is already bound...
             self = copy(self)
         self._args = args
         return self
 }}}
 For example
 {{{
         1    2.828    2.828   19.882   19.882
 {_home_florent__sage_temp_popcorn_rouba_net_19739_tmp_0_spyx_0.test}
    999999    2.429    0.000   15.759    0.000 copy.py:65(copy)
   1000000    1.088    0.000   17.054    0.000 lazy_format.py:82(__mod__)
   1999999    1.067    0.000    1.067    0.000 {hasattr}
 }}}
 I'm pretty sure that cythonizing properly this copy should give a large
 speedup. So the question is: should we try to optimize {{{LazyFormat}}} or
 do
 you rather have a hand tuned err-message to ensure proper backward
 compatibility ?

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

Reply via email to