#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:7 ncohen]:
 > > Cython does not perform deallocation, it is Python job.
 >
 > Well if you prefer, but this code is translated into C, and gcc may
 notice that the object is totally useless. They must have done something
 to keep those Python variables until the end.

 Nope. gcc will not do that. An affectation `G = H` is not one instruction
 if `H` is a Python object. Cython translates it into something like
 {{{
 cdef PyObject * G = H;
 Py_INCREF(G);
 }}}
 whick prevents deallocation of H until G is garbage collected (typically
 at the end of the function or until a call of `del G`).

 Vincent

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