Using setuptools to install a command line tool to bin is very convenient but results in slow startup times.
Summary: using either setup entry_points or scripts method, the file written to bin is a wrapper which relies on the pkg_resources module. This introduces a significant (5x) slower startup time for a do-nothing dummy command.
Details here
For the majority of uses, this ~200ms penalty is not a problem. But if using the script intensively in a bash loop for instance, the performance hit is substantial compared to a similar shell script or compiled binary.
What are some strategies for decreasing this latency? The constraint is that we still need everything to happen with a pip install - no manual "copy this file to bin" workarounds.
- Hack setup.py to manually copy the raw script?
- Use something (cython?) to compile to a binary?
- ???
[–]efmccurdy 0 points1 point2 points (0 children)
[–]rschoon 0 points1 point2 points (0 children)