Changes between Initial Version and Version 2 of Ticket #5345


Ignore:
Timestamp:
02/23/09 07:32:16 (13 years ago)
Author:
mabshoff
Comment:

A 18% speed improvement is never "trivial" for something like a basic operation like this :)

Cheers,

Michael

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5345

    • Property Priority changed from trivial to major
    • Property Summary changed from Optimize transpose for dense matrices to [with patch, needs review] Optimize transpose for dense matrices
  • Ticket #5345 – Description

    initial v2  
    11This patch has two changes to the transpose method in matrix_dense.pyx to provide about a 15% speedup.  If this is accepted, I'll look into the other non-sparse routines for transpose and antitranspose.
    22
    3 1.  A double loop indexes into the list of matrix entries using multiplication to create a reordered list for the transpose.  The effect of the multiplications is replaced by repeated additions.
     3 1.  A double loop indexes into the list of matrix entries using multiplication to create a reordered list for the transpose.  The effect of the multiplications is replaced by repeated additions.
    44
    5 2.  Retrieving the list in the original matrix makes a copy with list().  This has been replaced by the internal _list() to just reference the original.
     5 2.  Retrieving the list in the original matrix makes a copy with list().  This has been replaced by the internal _list() to just reference the original.
    66
    77Passes  sage -t  for  matrix2.pyx  and  matrix_dense.pyx
     
    1010time m.transpose()
    1111}}}
    12 Timings (user + system):[[BR]]
    13 11.94s : Stock 3.3[[BR]]
    14 11.20s : No multiplication[[BR]]
    15 10.18s : No multiplication, with _list()[[BR]]
     12Timings (user + system):
     13
     14 * 11.94s : Stock 3.3
     15 * 11.20s : No multiplication
     16 * 10.18s : No multiplication, with _list()