#12313: Fix yet another memory leak caused by caching of coercion data
--------------------------------------------------------+-------------------
       Reporter:  SimonKing                             |         Owner:        
                                               
           Type:  defect                                |        Status:  
positive_review                                      
       Priority:  major                                 |     Milestone:  
sage-5.8                                             
      Component:  memleak                               |    Resolution:        
                                               
       Keywords:  coercion weak dictionary              |   Work issues:        
                                               
Report Upstream:  N/A                                   |     Reviewers:  Simon 
King, Jean-Pierre Flori, John Perry, Nils Bruin
        Authors:  Simon King, Jean-Pierre Flori         |     Merged in:        
                                               
   Dependencies:  #715, #11521, #12215, #13746, #13378  |      Stopgaps:        
                                               
--------------------------------------------------------+-------------------

Comment (by SimonKing):

 Note the following:
 {{{
 sage: M=sage.structure.coerce_dict.MonoDict(23)
 sage: R = ZZ['x','y','z']
 sage: M[R]=1
 sage: D={R:1}
 sage: timeit("_=M[R]", number=10^6)
 1000000 loops, best of 3: 296 ns per loop
 sage: timeit("_=D[R]", number=10^6)
 1000000 loops, best of 3: 348 ns per loop
 sage: D[ZZ]=2
 sage: M[ZZ]=2
 sage: timeit("_=M[R]", number=10^6)
 1000000 loops, best of 3: 307 ns per loop
 sage: timeit("_=D[R]", number=10^6)
 1000000 loops, best of 3: 351 ns per loop
 }}}

 So, `MonoDict` isn't ''that'' bad, speed-wise. I am afraid I have no clue
 what the regression in `_=QQ(x)` really comes from. Python calls seem not
 to be involved, not with and not without #12313.

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