#10963: More functorial constructions
-------------------------------------+-------------------------------------
       Reporter:  nthiery            |        Owner:  stumpc5
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:
      Component:  categories         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Nicolas M. ThiƩry  |    Reviewers:  Simon King
Report Upstream:  N/A                |  Work issues:  Reduce startup time
         Branch:                     |  by 5%. Avoid "recursion depth
   Dependencies:  #11224, #8327,     |  exceeded (ignored)".
  #10193, #12895, #14516, #14722,    |       Commit:
  #13589, #14471                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nthiery):

 Ok, from Volker's suggestion on Sage-devel, one can raise a similar error
 message when garbage collecting the entries of a MonoDict (would be the
 same with a tripledict) involves a big recursion because deleting an entry
 triggers the deletion of another entry and so on:
 {{{
 from sage.structure.coerce_dict import MonoDict
 M = MonoDict(11)

 class A: pass
 a = A()
 prev = a

 for i in range(1000):
     newA = A()
     M[prev] = newA
     prev = newA

 len(M)
 del a
 Exception RuntimeError: 'maximum recursion depth exceeded while calling a
 Python object' in <sage.structure.coerce_dict.MonoDictEraser object at
 0x5a13788> ignored
 }}}

 At this point, my guess is that our weak dictionary infrastructure
 currently has an intrisic limitation on the depth of the reference graph,
 and that all the functioral construction patch does is putting a bit more
 stress and reach this limitation. So now the question is: is it possible
 to fix the weak dict infrastructure to let it scale properly by somehow
 unrolling the recursion as Volker suggests in [1].

 Cheers,

 [1] https://groups.google.com/d/msg/sage-devel/us0JCrRwGz0/McDlwepFve4J

--
Ticket URL: <http://trac.sagemath.org/ticket/10963#comment:91>
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to