First timing looks good. This is the same example as above, which (in unpatched sage) was 25.8 µs per loop for the creation of a new zero matrix and 13 µs per loop for copying an existing zero matrix.
With calloc instead of malloc, I obtain: sage: from sage.matrix.matrix_modn_dense import Matrix_modn_dense sage: MS = MatrixSpace(GF(3),100,100) sage: M = Matrix_modn_dense(MS, None,True,True) sage: timeit("M = Matrix_modn_dense(MS, None,True,True)", number=10000) 10000 loops, best of 3: 9.56 µs per loop So, it seems to help. If tests pass, I'll open a ticket and post a patch tomorrow. Best regards, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org