#14627: Make mod_int signed and speed up matrix_modn_dense_float
----------------------------------+-----------------------------------------
       Reporter:  vbraun          |         Owner:  jason, was  
           Type:  enhancement     |        Status:  needs_review
       Priority:  major           |     Milestone:  sage-5.10   
      Component:  linear algebra  |    Resolution:              
       Keywords:                  |   Work issues:              
Report Upstream:  N/A             |     Reviewers:              
        Authors:  Volker Braun    |     Merged in:              
   Dependencies:  #12728          |      Stopgaps:              
----------------------------------+-----------------------------------------

Old description:

> As discussed on https://groups.google.com/d/msg/sage-
> devel/hnO8gT8VON4/YyZ5UCM5wUEJ, unsigned longs are much slower than
> signed longs when converted to a Python object.
>
> Without patch about 20x slower than naive list-of-list implementation:
> {{{
> $ sage test_matrix_modn_float.py
> setA:
> 5 loops, best of 50: 179 ms per loop
> setB:
> 25 loops, best of 50: 10.3 ms per loop
> }}}
> With patch no performance difference:
> {{{
> $ sage test_matrix_modn_float.py
> setA:
> 25 loops, best of 50: 11.5 ms per loop
> setB:
> 25 loops, best of 50: 12.8 ms per loop
> }}}
>
> Also, I collected some common extern cdef statements in pxi headers and
> cleaned up the `MAX_MODULUS` declarations.
>
> Apply [attachment:trac_14627_signed_mod_int.patch]

New description:

 As discussed on https://groups.google.com/d/msg/sage-
 devel/hnO8gT8VON4/YyZ5UCM5wUEJ, unsigned longs are much slower than signed
 longs when converted to a Python object.

 Without patch about 20x slower than naive list-of-list implementation:
 {{{
 $ sage test_matrix_modn_float.py
 setA:
 5 loops, best of 50: 179 ms per loop
 setB:
 25 loops, best of 50: 10.3 ms per loop
 }}}
 With patch no performance difference:
 {{{
 $ sage test_matrix_modn_float.py
 setA:
 25 loops, best of 50: 11.5 ms per loop
 setB:
 25 loops, best of 50: 12.8 ms per loop
 }}}

 Also, I collected some common extern cdef statements in pxd headers and
 cleaned up the `MAX_MODULUS` declarations.

 Apply [attachment:trac_14627_signed_mod_int.patch]

--

Comment (by vbraun):

 Ok, sounds good. New patch uses `mod_int.pxd` and `stdint.pxd`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14627#comment:9>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to