#14532: Symplectic graphs
---------------------------------+------------------------------------------
       Reporter:  ncohen         |         Owner:  jason, ncohen, rlm
           Type:  enhancement    |        Status:  needs_review      
       Priority:  major          |     Milestone:  sage-5.10         
      Component:  graph theory   |    Resolution:                    
       Keywords:                 |   Work issues:                    
Report Upstream:  N/A            |     Reviewers:                    
        Authors:  Nathann Cohen  |     Merged in:                    
   Dependencies:                 |      Stopgaps:                    
---------------------------------+------------------------------------------

Comment (by azi):

 I may be shooting random nonsense of course but in general it is much
 better to not create lists [] but iterators (). Since in the former case a
 list has to first be created (1 for loop) and then iterated over (2 for
 loop). Example

 {{{
 sage: %timeit max((i for i in xrange(100)))
 100000 loops, best of 3: 14.5 us per loop
 sage: %timeit max([i for i in xrange(100)])
 10000 loops, best of 3: 30 us per loop
 }}}

 and even faster in this case would be

 {{{
 sage: %timeit 99
 1000000 loops, best of 3: 429 ns per loo
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14532#comment:4>
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