#14159: Don't install callbacks on values of TripleDict, MonoDict
------------------------------+---------------------------------------------
       Reporter:  nbruin      |         Owner:  tbd         
           Type:  defect      |        Status:  needs_review
       Priority:  major       |     Milestone:  sage-5.8    
      Component:  memleak     |    Resolution:              
       Keywords:              |   Work issues:              
Report Upstream:  N/A         |     Reviewers:  Nils Bruin  
        Authors:  Simon King  |     Merged in:              
   Dependencies:  #13387      |      Stopgaps:              
------------------------------+---------------------------------------------

Comment (by SimonKing):

 Replying to [comment:39 nbruin]:
 > "Premature optimization is the root of all evil" [Knuth]. Does their
 creation and deletion add considerably to the startup time?

 Probably not.

 > Probably not: The `__setitem__` and `__getitem__` lookups in python
 likely happen faster than normal method lookups in python, because the
 special methods are stored in slots, whereas normal method lookups have to
 resort to dictionary lookups.

 OK. That's calling overhead versus avoiding an additional test. That would
 be easy to test.

 But at least in cython modules, when one uses cdef'd variables of type
 `MonoDict` or `TripleDict`, using a cdef or cpdef set/get method directly
 should be faster than calling `__set/getitem__`, isn't it?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14159#comment:40>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to