#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 SimonKing):
Replying to [comment:14 nbruin]:
> ptest with CovariantFunctor.is_subcategory removed:
> {{{
> All tests passed!
> Total time for all tests: 992.9 seconds
> }}}
OK, then I think we should remove it.
> Main thing now would be to see if the next one on the list,
> {{{
> 2320 0.427 0.000 0.510 0.000 quotient_ring.py:322(__init__)
> }}}
> needs to cost as much as it does. And if the general one has to, whether
the path should be shortcut for creating finite fields.
If I remember correctly, improving the initialisation of finite fields was
part of #11900.
We could consider to put stuff from
`sage.rings.quotient_rings.QuotientRing_generic.__init__` or
`QuotientRing_nc.__init__` directly into
`sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic.__init__`
and
`sage.rings.finite_rings.finite_field_prime_modn.FiniteField_prime_modn.__init__`.
And we should test whether "small" finite fields shouldn't better be
cached. I see that the ''elements'' of an `IntegerModRing` of order less
than 500 are cached. But the rings themselves are ''not'' cached:
{{{
sage: id(IntegerModRing(123))
79926512
sage: import gc
sage: gc.collect()
673
sage: id(IntegerModRing(123))
78943376
}}}
versus
{{{
sage: R = IntegerModRing(123)
sage: R(12) is R(12)
True
}}}
Hence, I suggest that `IntegerModRing.__init__` puts the ring into a
strong cache, if it would also cache the elements.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13400#comment:16>
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.