Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scipy performance hit from doccer?

I'm doing a bit of performance tuning in a python application that makes heavy use of numpy and scipy. When using cProfile to find "hot" functions, I'm seeing a number of entries like:

427784   49.798    0.000  133.904    0.000 .../ve/lib/python2.7/site-packages/scipy/misc/doccer.py:12(docformat)

If I'm reading this correctly, doc formatting in the doccer.py module has been called 427,000 or so times, constituting about 49 seconds of the total runtime (even though each individual call is pretty fast). That's a pretty significant fraction of the total runtime!

I'm having a hard time finding more about doccer / docformatting (google always wants to substitute docker or soccer instead of doccer). Is there a way to disable it? Is it really as bad as it seems? Thanks!

like image 725
homesalad Avatar asked Sep 03 '25 02:09

homesalad


1 Answers

Coming way too late to this question, I'm guessing that somewhere in the application, it's using scipy "frozen" distributions, e.g. stats.norm(0, 1).rvs(size=10) instead of stats.norm.rvs(0, 1, size=10).

like image 190
ev-br Avatar answered Sep 04 '25 15:09

ev-br