#11900: Serious regression caused by #9138
------------------------------+---------------------------------------------
Reporter: SimonKing | Owner: tbd
Type: defect | Status: needs_work
Priority: critical | Milestone: sage-4.8
Component: performance | Keywords: categories regression
Work_issues: | Upstream: N/A
Reviewer: Jeroen Demeyer | Author: Simon King
Merged: | Dependencies: #9138 #11911
------------------------------+---------------------------------------------
Comment(by SimonKing):
Replying to [comment:96 nthiery]:
> The change was motivated by the fact that, in may important cases,
``X.is_field()``
> is much faster than ``X in Fields()``:
> ...
> Hopefully, with that patch or some variant thereof, the changes ``X in
> Fields()`` -> ``X.is_field()`` in trac11900_category_speedup.patch can
> be reverted while still solving the original regression.
I hope so! I think that the following makes sense: We change here the
`__contains__` method for `Rings()`, because that is what is needed most.
The change shall be: Instead of creating the list of all super categories
and then searching `Rings()` in that list, one should test whether the
parent class of is a subclass of the parent class of `Rings()`. In
particular, this can be put into Cython, where IIRC subclass checks are
much faster than in Python.
On the long run, we could think of making subclass check of parent_class
the default way of testing is_subcategory (this is one of the things we
had discusses). Of course, when sharing parent classes (as in #11935),
this has to be weakened.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11900#comment:97>
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.