#715: Parents probably not reclaimed due to too much caching
------------------------+---------------------------------------------------
Reporter: robertwb | Owner: somebody
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.8
Component: coercion | Keywords: weak cache coercion
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #9138, #11900
------------------------+---------------------------------------------------
Comment(by SimonKing):
Here is some more data. In all cases, I give the number of maps and
actions created, first with #11780 only and then with #11780+#715.
First test: Start Sage!
-> 191 maps, 44 actions versus 191 maps, 44 actions. Fine!
Second test:
{{{
E = J0(46).endomorphism_ring()
g = E.gens()
}}}
-> 597 maps, 320 actions versus 611 maps, 481 actions. That's about 50%
more actions and is thus not good.
Third test:
{{{
L = EllipticCurve('960d1').prove_BSD()
}}}
-> 3550 maps, 97 actions versus 3550 maps, 97 actions. Fine!
Fourth test:
{{{
E = EllipticCurve('389a')
for p in prime_range(10000):
if p != 389:
G = E.change_ring(GF(p)).abelian_group()
}}}
-> 14969 maps, 9884 actions versus 14969 maps, 9885 actions. Fine!
Question to the reviewer: How bad do you think is the "missing action" in
the second example? Would it be worth while to fix it in the method
`E.gens`?
Would you even think I should try to modify `TripleDict` so that a list of
''strong'' references is preserved, but the list can only have a maximal
length (thus popping the first references on the list when new references
are appended)? In that way, one could extend the life time of the cache,
but at the same time one would avoid an infinite memory growth.
It is a shame that Python only has strong and weak references, but no soft
references!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/715#comment:136>
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.