Add callgraph stuff. Slick look.

This commit is contained in:
Paul Tagliamonte 2014-01-10 21:02:14 -05:00
parent 5017e3c211
commit c0a654e6cb

View File

@ -23,7 +23,15 @@
;;; These macros make debugging where bottlenecks exist easier.
(defmacro/g! profile [&rest body]
(defmacro profile/calls [&rest body]
`(do
(import [pycallgraph [PyCallGraph]]
[pycallgraph.output [GraphvizOutput]])
(with* [(apply PyCallGraph [] {"output" (GraphvizOutput)})]
~@body)))
(defmacro/g! profile/cpu [&rest body]
" Profile a bit of code "
`(do
(import cProfile pstats)