#18250: G.triangles_count speedup
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.7
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  fa6115dc6cdea907dad9c2cd69668f5e71660024
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  public/18250           |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by vdelecroix):

 Replying to [comment:5 ncohen]:
 > > You always perform a copy?! Isn't it possible to have a graph whose
 backend is already a `static_sparse_graph` or a `static_dense_graph`?
 > Fortunately the copy `G` is not deleted until the end of the function.
 If Cython ever notices that (as far as it is concerned) it is never used
 again in the function, then it will be deallocated and we will get a
 segfault again.

 Cython does not perform deallocation, it is Python job. Though Cython does
 increment/decrement the reference counter. And precisely, doing `G =
 G.copy(immutable=True)` precisely increment the reference counter!

 Looks good! I am running the tests...

 Vincent

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