#9138: Categories for polynomial rings
-----------------------------------------+----------------------------------
Reporter: jbandlow | Owner: nthiery
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.7
Component: categories | Keywords: introspection,
categories for rings
Author: Simon King | Upstream: N/A
Reviewer: | Merged:
Work_issues: Improve Monsky-Washnitzer |
-----------------------------------------+----------------------------------
Comment(by SimonKing):
Closing in...
With patches
{{{
sage: %prun L=[x*T for _ in xrange(1000)]
392002 function calls in 0.766 CPU seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
384000 0.371 0.000 0.371 0.000
polynomial_ring.py:1836(modulus)
1000 0.367 0.000 0.724 0.001
monsky_washnitzer.py:553(_mul_)
1 0.017 0.017 0.766 0.766 <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}
}}}
Without patches:
{{{
sage: %prun L=[x*T for _ in xrange(1000)]
404602 function calls in 0.684 CPU seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
1000 0.366 0.000 0.651 0.001
monsky_washnitzer.py:553(_mul_)
384600 0.234 0.000 0.234 0.000
polynomial_ring.py:1797(modulus)
2000 0.047 0.000 0.061 0.000
polynomial_ring.py:212(_element_constructor_)
1 0.018 0.018 0.684 0.684 <string>:1(<module>)
2000 0.007 0.000 0.007 0.000
integer_mod_ring.py:726(_repr_)
2000 0.005 0.000 0.006 0.000
integer_mod_ring.py:911(__cmp__)
1000 0.003 0.000 0.004 0.000
monsky_washnitzer.py:325(__init__)
4000 0.003 0.000 0.003 0.000 {isinstance}
4000 0.001 0.000 0.001 0.000 {method 'parent' of
'sage.structure.element.Element' objects}
2000 0.001 0.000 0.001 0.000 {cmp}
2000 0.000 0.000 0.000 0.000 {method 'base_ring' of
'sage.structure.category_object.CategoryObject' objects}
1 0.000 0.000 0.000 0.000 {method 'disable' of
'_lsprof.Profiler' objects}
}}}
In other words: The biggest loss is the call to `modulus()`. That should
be possible to fix.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9138#comment:29>
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.