#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           
Work_issues:              |       Upstream:  N/A                                
           
   Reviewer:              |         Author:  Simon King                         
           
     Merged:              |   Dependencies:  sage-4.7, #11268, #11139, #9976, 
#9944, #11269
--------------------------+-------------------------------------------------

Comment(by SimonKing):

 The dependencies of this patch are stated in the corresponding form field.
 For the following timings, I additionally have #11298, #11267 and, in
 particular, #11115.

 In some cases, there is quite an improvement, compared with the timings
 that are stated in previous comments! Note that the times per loop change,
 depending on whether one lets timeit run `10^4` loops (as in #9944) or one
 simply does `timeit` without any specification.

 First series of timings: I guess most of the speedup is due to #9944
 {{{
 sage: R.<x> = ZZ[]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 20.9 µs per loop
 # unpatched 625 loops, best of 3: 22.5 µs per loop
 sage: R.<x> = QQ[]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 21.3 µs per loop
 # unpatched 625 loops, best of 3: 24.5 µs per loop
 sage: R.<x> = GF(3)[]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 19.2 µs per loop
 # unpatched 625 loops, best of 3: 87.7 µs per loop
 sage: R.<x> = QQ['t'][]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 75.4 µs per loop
 # unpatched 625 loops, best of 3: 114 µs per loop
 sage: R.<x,y> = ZZ[]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 19.7 µs per loop
 # unpatched 625 loops, best of 3: 21.9 µs per loop
 sage: R.<x,y> = QQ[]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 18.2 µs per loop
 # unpatched 625 loops, best of 3: 40 µs per loop
 sage: R.<x,y> = GF(3)[]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 15.8 µs per loop
 # unpatched 625 loops, best of 3: 26.3 µs per loop
 sage: R.<x,y> = QQ['t'][]
 sage: timeit('(2*x-1)^2+5')
 625 loops, best of 3: 162 µs per loop
 # unpatched 625 loops, best of 3: 239 µs per loop
 }}}

 Timings for some "schemes" tests.
 {{{
 sage -t  "devel/sage-main/sage/schemes/elliptic_curves/sha_tate.py"
          [29.5 s]
 }}}
 I have not the faintest idea where that slow-down might come from. Namely,
 the underlying arithmetic has drastically improved:
 {{{
 sage: B.<t> = PolynomialRing(Integers(125))
 sage: R = monsky_washnitzer.SpecialCubicQuotientRing(t^3 - t + B(1/4))
 sage: x, T = R.gens()
 sage: timeit('x*T')
 625 loops, best of 3: 179 µs per loop
 # unpatched: 625 loops, best of 3: 612 µs per loop
 }}}
 and
 {{{
 sage: B.<t> = PolynomialRing(Integers(125))
 sage: R = monsky_washnitzer.SpecialCubicQuotientRing(t^3 - t + B(1/4))
 sage: P = R.poly_ring()
 sage: timeit('P.modulus()',number=10^6)
 1000000 loops, best of 3: 161 ns per loop
 # unpatched: 1000000 loops, best of 3: 647 ns per loop
 sage: x, T = R.gens()
 sage: timeit('x*T')
 625 loops, best of 3: 177 µs per loop
 # unpatched: 625 loops, best of 3: 495 µs per loop
 }}}

 And the startup time (which is also relevant for doctests:
 {{{
 1.326 sage.all (None)
 0.324 sage.schemes.all (sage.all)
 0.184 sage.misc.all (sage.all)
 0.160 hyperelliptic_curves.all (sage.schemes.all)
 }}}

 I'd appreciate if someone could explain why the doctest time in
 sage.schemes increased, while the underlying arithmetics became faster.

 Overall, I think that the performance is quite good, and of course the
 main point of this ticket (namely to implement the category framework for
 rings) was successfully addressed.

 Review, anyone?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9138#comment:62>
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.

Reply via email to