#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):
Here is how one can cythonise the default `_subcategory_hook_`. The time
for testing subcategories drops clearly. Without patch:
{{{
sage: C = Algebras(ZZ)
sage: R = Rings()
sage: %timeit R.is_subcategory(C)
625 loops, best of 3: 3.14 µs per loop
sage: %timeit C.is_subcategory(R)
625 loops, best of 3: 3.4 µs per loop
}}}
With patch:
{{{
sage: C = Algebras(ZZ)
sage: R = Rings()
sage: %timeit R.is_subcategory(C)
625 loops, best of 3: 1.97 µs per loop
sage: %timeit C.is_subcategory(R)
625 loops, best of 3: 2.1 µs per loop
}}}
However, that doesn't much improve the performance of
{{{
sage: def test1(N,B,t):
....: for i in range(t):
....: m=matrix(QQ,N,N,srange(N*N)).echelon_form()
....:
}}}
which (together with the fact that _subcategory_hook_ does all the work in
this example) shows that the problem is not in the subcategory test.
Hence, my patch is off-topic.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13400#comment:8>
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.