google / python-fire

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
Other
27.04k stars 1.44k forks source link

Why so slow? #68

Closed john9631 closed 7 years ago

john9631 commented 7 years ago

Great concept and I like how it works except for one thing I noticed - it's very slow to initialize especially with Python3.

time python fireexpt.py

yeilds 0.3 seconds for python 2 and 0.74 seconds for python 3 where fireexpt does nothing but import fire and fire.Fire() if name is main. There is no code to evaluate. Actually its as slow if you just import fire and pass.

Am I missing something, is this likely to continue, or can it be significantly improved? I love the tool and have been trying to see what's happening - it seems to be generating lots of classes for no obvious reason.

dbieber commented 7 years ago

The reason for the slowness is the dependency on IPython. 3db47f8 addresses this. See #7 for additional information about this dependency and what we're doing to mitigate it. The speedup is already available on master and will be available in the next release.

john9631 commented 7 years ago

Excellent. Installed master. All copacetic thanks.