#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 nbruin):

 Hm, simply deleting `is_subclass` from `CovariantCategory` leads to a
 similar speedup:
 multimodular echelonization loop 5.3b2 + tickets + removed
 `CovariantCategory.is_subcategory`:
 {{{
          1341369 function calls (1307374 primitive calls) in 4.993 seconds

    Ordered by: internal time

    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      1000    2.070    0.002    4.590    0.005 {method 'echelon_form' of
 'sage.matrix.matrix_rational_dense.Matrix_rational_dense' objects}
      2320    0.427    0.000    0.510    0.000
 quotient_ring.py:322(__init__)
      6089    0.187    0.000    0.188    0.000
 dynamic_class.py:259(dynamic_class_internal)
      5000    0.185    0.000    0.919    0.000 matrix_space.py:1180(matrix)
      4996    0.177    0.000    0.424    0.000
 matrix_space.py:230(__init__)
      2320    0.121    0.000    0.140    0.000 {method 'ideal' of
 'sage.rings.ring.Ring' objects}
     16466    0.091    0.000    0.099    0.000 {method 'is_prime' of
 'sage.rings.integer.Integer' objects}
      6618    0.087    0.000    0.275    0.000 category.py:112(_join)
      1000    0.084    0.000    0.084    0.000 {method 'range' of
 'sage.rings.integer_ring.IntegerRing_class' objects}
 18305/6310    0.079    0.000    0.576    0.000
 lazy_attribute.py:506(__get__)
         1    0.071    0.071    4.995    4.995 <ipython console>:1(test1)
     14488    0.063    0.000    0.192    0.000 arith.py:401(is_prime)
     44850    0.057    0.000    0.073    0.000 weakref.py:55(__getitem__)
    129931    0.053    0.000    0.053    0.000 {isinstance}
     10000    0.051    0.000    0.542    0.000
 matrix_space.py:154(__classcall__)
      2973    0.048    0.000    0.249    0.000 {sage.rings.ring.is_Field}
      2320    0.047    0.000    0.870    0.000
 integer_mod_ring.py:191(__init__)
      2000    0.046    0.000    0.219    0.000
 arith.py:1051(previous_prime)
      1995    0.041    0.000    0.154    0.000
 matrix_space.py:1133(zero_matrix)
 6000/1000    0.036    0.000    0.496    0.000
 category.py:1023(parent_class)
      7000    0.035    0.000    0.046    0.000
 category_types.py:261(__init__)
      3973    0.035    0.000    0.068    0.000
 sageinspect.py:917(sage_getargspec)
     19703    0.035    0.000    0.079    0.000 weakref.py:79(__setitem__)
      4996    0.034    0.000    0.059    0.000
 matrix_space.py:904(_get_matrix_class)
      2000    0.032    0.000    0.052    0.000 sequence.py:86(Sequence)
     69720    0.032    0.000    0.073    0.000
 category.py:1102(is_subcategory)
     12000    0.029    0.000    0.057    0.000 misc.py:179(cputime)
     67400    0.028    0.000    0.041    0.000
 category.py:622(_subcategory_hook_)
 12996/9996    0.026    0.000    0.489    0.000
 unique_representation.py:452(__classcall__)
       995    0.026    0.000    0.084    0.000 homset.py:80(Hom)
       995    0.026    0.000    0.051    0.000 homset.py:353(__init__)
     14488    0.026    0.000    0.031    0.000 all.py:1(arithmetic)
     25673    0.025    0.000    0.025    0.000 weakref.py:228(__init__)
     12000    0.021    0.000    0.021    0.000 {resource.getrusage}
     57510    0.019    0.000    0.057    0.000 category.py:148(<genexpr>)
 12996/9996    0.019    0.000    0.467    0.000
 {sage.misc.classcall_metaclass.typecall}
     27993    0.019    0.000    0.029    0.000 weakref.py:223(__new__)
      1000    0.018    0.000    0.155    0.000 misc.py:1051(srange)
     50892    0.018    0.000    0.053    0.000 category.py:150(<genexpr>)
 }}}
 As you can see, it's really the construction of the quotient rings now
 that's expensive (i.e., the finite fields). That would get better with
 having a multimodular fields cache.

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