parent
e588b4928d
commit
115b7dd5fa
@ -12,5 +12,6 @@ Contents:
|
|||||||
flow
|
flow
|
||||||
loop
|
loop
|
||||||
multi
|
multi
|
||||||
|
profile
|
||||||
sequences
|
sequences
|
||||||
walk
|
walk
|
||||||
|
57
docs/contrib/profile.rst
Normal file
57
docs/contrib/profile.rst
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
==========
|
||||||
|
Profile
|
||||||
|
==========
|
||||||
|
|
||||||
|
.. versionadded:: 0.10.0
|
||||||
|
|
||||||
|
The ``profile`` macros make debugging where bottlenecks exist easier..
|
||||||
|
|
||||||
|
|
||||||
|
Macros
|
||||||
|
======
|
||||||
|
|
||||||
|
.. _profile/calls:
|
||||||
|
.. _profile/cpu:
|
||||||
|
|
||||||
|
profile/calls
|
||||||
|
--------------
|
||||||
|
|
||||||
|
``profile/calls`` allows you to create a call graph visualization.
|
||||||
|
**Note:** You must have `Graphviz <http://www.graphviz.org/Home.php>`_
|
||||||
|
installed for this to work.
|
||||||
|
|
||||||
|
|
||||||
|
Usage: `(profile/calls (body))`
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: hy
|
||||||
|
|
||||||
|
(require [hy.contrib.profile [profile/calls]])
|
||||||
|
(profile/calls (print "hey there"))
|
||||||
|
|
||||||
|
|
||||||
|
profile/cpu
|
||||||
|
------------
|
||||||
|
|
||||||
|
``profile/cpu`` allows you to profile a bit of code.
|
||||||
|
|
||||||
|
Usage: `(profile/cpu (body))`
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: hy
|
||||||
|
|
||||||
|
(require [hy.contrib.profile [profile/cpu]])
|
||||||
|
(profile/cpu (print "hey there"))
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
hey there
|
||||||
|
<pstats.Stats instance at 0x14ff320>
|
||||||
|
2 function calls in 0.000 seconds
|
||||||
|
|
||||||
|
Random listing order was used
|
||||||
|
|
||||||
|
ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
|
||||||
|
1 0.000 0.000 0.000 0.000 {print}
|
Loading…
x
Reference in New Issue
Block a user