#13400: Use strong caches diligently
-------------------------------+--------------------------------------------
Reporter: nbruin | Owner: robertwb
Type: enhancement | Status: new
Priority: major | Milestone: sage-wishlist
Component: coercion | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-------------------------------+--------------------------------------------
Comment (by nbruin):
I think this illustrates quite nicely what the problems are here:
{{{
sage: import collections
sage: collections.Counter(type(a) for a in SetPartitionsAk(3))
Counter({<class 'sage.sets.set.Set_object_enumerated_with_category'>:
203})
}}}
One creates a parent `SetPartitionsAk(3)` and its elements (a lot of them)
are parents themselves! Previously, this code was essentially working on a
`dealloc=no-op` memory model. Now it's a bit slower than it was before.
Conceptually, one would probably want an "element-like" object first, with
delayed "parent" properties. Only when the user insists on treating the
thing as a parent do the parent-like properties get initialized. I don't
know whether it's worth having something like this. I suspect that if you
want to access elements of `SetPartitionsAk(3)` for speed, you should
probably just have a way of getting representatives as plain lists (or
python sets).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13400#comment:23>
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.