Commit d0530380 authored by Lars Buitinck's avatar Lars Buitinck

expand section on cython -a output

* explain new "+" signs in front of lines
* explain different shades of yellow
* relation to nogil blocks
parent 3154bef3
...@@ -124,8 +124,15 @@ tell you why your code is taking time. ...@@ -124,8 +124,15 @@ tell you why your code is taking time.
Using the ``-a`` switch to the ``cython`` command line program (or Using the ``-a`` switch to the ``cython`` command line program (or
following a link from the Sage notebook) results in an HTML report following a link from the Sage notebook) results in an HTML report
of Cython code interleaved with the generated C code. Lines are of Cython code interleaved with the generated C code. Lines are
colored according to the level of "typedness" -- white lines colored according to the level of "typedness" --
translates to pure C without any Python API calls. This report white lines translate to pure C,
is invaluable when optimizing a function for speed. while lines that require the Python C-API are yellow
(darker as they translate to more C-API interaction).
Lines that translate to C code have a plus (``+``) in front
and can be clicked to show the generated code.
This report is invaluable when optimizing a function for speed,
and for determining when to :ref:`release the GIL <nogil>`:
in general, a ``nogil`` block may contain only "white" code.
.. figure:: htmlreport.png .. figure:: htmlreport.png
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment