#15104: Special case modn_dense matrix operations to improve performance
-------------------------------------+-------------------------------------
       Reporter:  nbruin             |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.2
      Component:  linear algebra     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Nils Bruin, Simon  |    Reviewers:
  King                               |  Work issues:  regression in
Report Upstream:  N/A                |  right_kernel_matrix
         Branch:                     |       Commit:
  u/SimonKing/ticket/15104           |  0f008f9266e3ed6fbd67e7f3d357474825bdb160
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Here is the same in the master branch:
 {{{
    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      1000    0.078    0.000    0.124    0.000 matrix_space.py:1187(matrix)
      1000    0.068    0.000    0.168    0.000
 matrix_space.py:221(__init__)
      1000    0.058    0.000    0.453    0.000 {method
 'right_kernel_matrix' of 'sage.matrix.matrix2.Matrix' objects}
      1000    0.034    0.000    0.069    0.000
 matrix_space.py:911(_get_matrix_class)
     15000    0.032    0.000    0.032    0.000 {isinstance}
      1000    0.029    0.000    0.227    0.000
 matrix_space.py:145(__classcall__)
      2000    0.017    0.000    0.031    0.000 misc.py:161(cputime)
      9000    0.013    0.000    0.013    0.000 {len}
         1    0.011    0.011    0.464    0.464 <string>:1(<module>)
      6000    0.010    0.000    0.010    0.000
 finite_field_prime_modn.py:272(order)
      1000    0.010    0.000    0.014    0.000
 category.py:435(__classcall__)
      2000    0.009    0.000    0.009    0.000 {resource.getrusage}
      1000    0.008    0.000    0.031    0.000
 modules.py:70(__classcall_private__)
      2000    0.008    0.000    0.039    0.000 misc.py:392(verbose)
      1000    0.008    0.000    0.183    0.000
 unique_representation.py:1006(__classcall__)
      4000    0.007    0.000    0.007    0.000 {method 'extend' of 'list'
 objects}
      1000    0.006    0.000    0.010    0.000
 finite_field_prime_modn.py:99(__cmp__)
      1000    0.006    0.000    0.020    0.000
 vector_spaces.py:34(__classcall_private__)
      1000    0.006    0.000    0.174    0.000
 {sage.misc.classcall_metaclass.typecall}
      1000    0.005    0.000    0.129    0.000
 matrix_space.py:387(__call__)
      1000    0.004    0.000    0.006    0.000 weakref.py:223(__new__)
      1000    0.004    0.000    0.004    0.000 weakref.py:228(__init__)
      1000    0.004    0.000    0.006    0.000
 group_element.py:77(is_MatrixGroupElement)
      1000    0.003    0.000    0.006    0.000
 rational_field.py:994(is_RationalField)
      1000    0.003    0.000    0.005    0.000
 integer_mod_ring.py:148(is_IntegerModRing)
      2000    0.003    0.000    0.003    0.000
 finite_field_prime_modn.py:202(characteristic)
      1000    0.003    0.000    0.005    0.000
 number_field.py:920(is_CyclotomicField)
      1000    0.003    0.000    0.003    0.000 fields.py:60(__contains__)
      1000    0.002    0.000    0.002    0.000 {cmp}
      1000    0.002    0.000    0.002    0.000 {built-in method __new__ of
 type object at 0xb774dfc0}
      1000    0.002    0.000    0.002    0.000
 matrix_space.py:1077(is_dense)
      1000    0.002    0.000    0.002    0.000 matrix_space.py:1415(nrows)
      1000    0.002    0.000    0.002    0.000 matrix_space.py:1403(ncols)
      1000    0.002    0.000    0.002    0.000
 {sage.rings.integer_ring.is_IntegerRing}
      1000    0.002    0.000    0.002    0.000
 {sage.matrix.matrix.is_Matrix}
      1000    0.002    0.000    0.002    0.000 {method 'base_ring' of
 'sage.structure.category_object.CategoryObject' objects}
         1    0.000    0.000    0.000    0.000 {range}
         1    0.000    0.000    0.000    0.000 {method 'disable' of
 '_lsprof.Profiler' objects}
 }}}

 So, we see the following regression in cumulative time:
 {{{
 vector_spaces.py:34(__classcall_private__) 0.020 --> 0.265
 }}}
 In fact, we see `1000    0.005    0.000    0.197    0.000
 vector_spaces.py:64(__init__)` with the current ticket branch, but is does
 not occur at all with the matrix branch.

 Hence, I guess to fix the regression we need to address this question: Why
 is the category of vector spaces (probably the one over `GF(5)`) not taken
 from cache?

--
Ticket URL: <http://trac.sagemath.org/ticket/15104#comment:21>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to