id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
11046,Some comments in the code of SparseGraph,ncohen,jason ncohen rlm,"I was reading this code to understand a bit better how the SparseGraph backend worked (as it is the default one in Sage), and added comments while I was at it.
I also replaced some loops initializing values by a memset, as it is usually faster. This produces next-to-zero improvement in Sage, but well.. `:-)`
Before :
{{{
625 loops, best of 3: 1.26 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.25 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.47 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.25 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.25 ms per loop
sage: %timeit Graph(100)
625 loops, best of 3: 94.7 µs per loop
sage: %timeit Graph(100)
625 loops, best of 3: 98.8 µs per loop
sage: %timeit Graph(100)
625 loops, best of 3: 95.8 µs per loop
sage: %timeit Graph(100)
625 loops, best of 3: 95.2 µs per loop
sage: %timeit Graph(100)
625 loops, best of 3: 96.6 µs per loop
sage: %timeit Graph(100)
625 loops, best of 3: 95.2 µs per loop
}}}
After
{{{
sage: %timeit Graph(10000)
625 loops, best of 3: 1.15 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.15 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.15 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.21 ms per loop
sage: %timeit Graph(10000)
625 loops, best of 3: 1.15 ms per loop
sage: %timeit Graph(100)
625 loops, best of 3: 94.5 µs per loop
sage: %timeit Graph(100)
625 loops, best of 3: 92.7 µs per loop
sage: %timeit Graph(100)
625 loops, best of 3: 93.5 µs per loop
}}}
By the way Robert, this is all mostly about touching your code and adding comments, and as I am trespassing I expect you may not like some of those `:-)`
Nathann",enhancement,closed,trivial,sage-4.7,graph theory,fixed,,rlm,sage-4.7.alpha5,Nathann Cohen,Robert Miller,N/A,,,,,