#11900: Serious regression caused by #9138
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: tbd
Type: defect | Status: needs_work
Priority: blocker | Milestone: sage-4.7.2
Component: performance | Keywords: categories regression
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #9138
---------------------------+------------------------------------------------
Comment(by SimonKing):
Still, there is too much time spent on the initialisation of polynomial
rings. And the reason seems to be the construction of the parent class of
the categories.
A polynomial ring over a finite prime field F belongs to the category of
Commutative Algebras of F (by #9138). In order to provide the ring with
the correct class (`PolynomialRing_dense_mod_p_with_category` in this
case), one needs to have the parent class of `CommutativeAlgebras(F)`. But
this involves to know the parent classes of F algebras, F vector spaces, F
bimodules, F left modules, F right modules, and rings.
During the elliptic curve computation, F varies. Hence, all the base
classes need to be computed over and over again.
I wonder whether it is possible to make the parent class of a category
''independent'' of the base (here: F) of the category. Then, one could
avoid the creation of about 5000 dynamic classes during the elliptic curve
computation. I guess that's a question to sage-combinat-devel.
How might this work? Perhaps make the parent class of a category a class
attribute: `Algebras(F).parent_class` depends on `F`, but
`Algebras(F).__class__.parent_class` would be independent of F. Or perhaps
one should better introduce a central cache for the parent and element
classes, so that `Algebras(F).parent_class` is just a pointer to
`parent_class_cache[sage.categories.algebras.Algebras]`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11900#comment:31>
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.