3 ms·
On my system (macOS) I see a minimum of 0m0.034 for Python 3.6.1 and a minimum of 0m0.022 for Python 2.7.13 -- so Python 3.6 is 50% slower. This is a somewhat
by benhoyt 9y ago
On my system (macOS) I see a minimum of 0m0.034 for Python 3.6.1 and a minimum of 0m0.022 for Python 2.7.13 -- so Python 3.6 is 50% slower.
This is a somewhat contrived example, however. As the article notes, it's worse when you have a lot of imports (and I don't know how that'd differ between versions 2 and 3). I remember talking to some folks at Google who work on the Google Cloud CLI, and they said that Python startup time is a constant problem for their (large) codebase. Especially when it's used for tab completion, because it might run every time you press tab, and the user wants instant results.
- sillysaurus3 9y agoAha, tab completion makes sense. Thanks!
- mikepurvis 9y agoWe're dealing with this on a CLI build tools project I hack on (catkin_tools). It uses plugin discovery based on entry_points, and short of caching plugins in a homedir file, it's basically impossible to make it fast enough to use with something like argcomplete. Relevant ticket: https://github.com/catkin/catkin_tools/issues/297 https://github.com/catkin/catkin_tools/issues/297
- smcl 9y agoWhy on earth would they think invoking a new interpreter each time someone hits "tab" would do anything except perform suboptimally?