#9138: Categories for all rings
--------------------------+-------------------------------------------------
Reporter: jbandlow | Owner: nthiery
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7
Component: categories | Keywords: introspection, categories for rings
Author: Simon King | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
Comment(by SimonKing):
Replying to [comment:40 SimonKing]:
> I leave the decision to the reviewer whether or not #11115, together
with a patch that puts a cached_method decorator in front of the modulus
method, should be a dependency for this ticket.
Apparently there is no reviewer :(
Anyway. I modified the patch so that now `modulus()` becomes a cached
method. This provides a speed-up even without #11115. And once #11115 is
merged as well, the speed-up will increase.
Without #11115, but with the patches from #9944 and from here:
{{{
sage: B.<t> = PolynomialRing(Integers(125))
sage: R = monsky_washnitzer.SpecialCubicQuotientRing(t^3 - t + B(1/4))
sage: P = R.poly_ring()
sage: x, T = R.gens()
# Without patches, the following was 495 µs per loop
sage: timeit('x*T')
625 loops, best of 3: 472 µs per loop
sage: %prun L=[x*T for _ in xrange(1000)]
392002 function calls in 0.590 CPU seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
1000 0.385 0.000 0.560 0.001
monsky_washnitzer.py:553(_mul_)
384000 0.177 0.000 0.177 0.000 cachefunc.py:505(__call__)
1 0.019 0.019 0.590 0.590 <string>:1(<module>)
2000 0.006 0.000 0.006 0.000
integer_mod_ring.py:726(_repr_)
1000 0.003 0.000 0.004 0.000
monsky_washnitzer.py:325(__init__)
2000 0.001 0.000 0.001 0.000 {isinstance}
2000 0.000 0.000 0.000 0.000 {method 'parent' of
'sage.structure.element.Element' objects}
1 0.000 0.000 0.000 0.000 {method 'disable' of
'_lsprof.Profiler' objects}
}}}
That's better than with an unpatched Sage and thus good enough.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9138#comment:41>
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.