#17384: Slowness when calling Graph(a_dictionary)
-----------------------------+---------------------------------
   Reporter:  ncohen         |            Owner:
       Type:  defect         |           Status:  new
   Priority:  major          |        Milestone:  sage-6.5
  Component:  PLEASE CHANGE  |         Keywords:
  Merged in:                 |          Authors:  Nathann Cohen
  Reviewers:                 |  Report Upstream:  N/A
Work issues:                 |           Branch:
     Commit:                 |     Dependencies:
   Stopgaps:                 |
-----------------------------+---------------------------------
 It has been reported by Jean Betrema on sage-devel [1] that building a
 graph from a dictionary was actually quite slow

 {{{
 sage: d=graphs.Grid2dGraph(100,100).to_dictionary()
 sage: %time Graph(d)
 CPU times: user 2.67 s, sys: 20 ms, total: 2.69 s
 Wall time: 2.63 s
 Graph on 10000 vertices
 }}}

 This does not make any sense, and indeed it only comes from a miswritten
 line in the code. After this branch is applied, it becomes

 {{{
 sage: d=graphs.Grid2dGraph(100,100).to_dictionary()
 sage: %time Graph(d)
 CPU times: user 104 ms, sys: 4 ms, total: 108 ms
 Wall time: 97.2 ms
 Graph on 10000 vertices
 }}}

 Nathann

 [1] https://groups.google.com/d/msg/sage-devel/x3h4m3LjWkI/1HY80TsjxCoJ

--
Ticket URL: <http://trac.sagemath.org/ticket/17384>
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to