#14659: Useless memory allocation in subgraph_search
----------------------------+-----------------------------------------------
   Reporter:  ncohen        |             Owner:  jason, ncohen, rlm
       Type:  defect        |            Status:  new               
   Priority:  major         |         Milestone:  sage-5.10         
  Component:  graph theory  |          Keywords:                    
Work issues:                |   Report Upstream:  N/A               
  Reviewers:                |           Authors:  Nathann Cohen     
  Merged in:                |      Dependencies:                    
   Stopgaps:                |  
----------------------------+-----------------------------------------------
 This patch exist because I am an idiot.

 This should also solve the other problem of this class : it often
 segfaults when using CTRL+C while it computes.

 Not spending its lifetime allocating and freeing memory is definitely a
 step in the right direction.

 And this will have to be rewritten with a real data structure someday,
 like the one from #14589 `>_<`

 Before :
 {{{
 sage: g = graphs.CompleteMultipartiteGraph([9]*5)
 sage: %time g.subgraph_search(graphs.CompleteGraph(6))
 CPU times: user 18.31 s, sys: 0.01 s, total: 18.32 s
 Wall time: 18.36 s
 }}}

 After:
 {{{
 sage: g = graphs.CompleteMultipartiteGraph([9]*5)
 sage: %time g.subgraph_search(graphs.CompleteGraph(6))
 CPU times: user 6.95 s, sys: 0.00 s, total: 6.95 s
 Wall time: 6.96 s
 }}}

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14659>
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