#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                 
---------------------------+------------------------------------------------

Comment(by hivert):

 > In addition I don't think that you can come up to speed, even with
 cython,
 > if you need to copy strings etc. The point of `AttributeErrorMessage` is
 to
 > assign two attributes (without copying, so, it just sets two pointers to
 > existing objects) ''and nothing else''.

 Please have a look at the code... I'm just copying the object itself if it
 is
 bound with two different objects. Now using copy.copy from python is
 always
 awfully slow. So I'm basically creating a new object as you have to do.

 > Of course, you may try to tune the lazy format strings so that they are
 fast
 > enough for the application here. But for the moment, I really don't see
 why
 > one should not introduce a very slim new class (it only has `__init__`
 and
 > `__repr__`), if it is faster and offers backward compatibility for free.

 If you tell me you won't use it, I'm less motivated to tune it finely ;-)

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