This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gwk
Recipients gwk
Date 2018-06-19.14:34:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529418857.83.0.56676864532.issue33902@psf.upfronthosting.co.za>
In-reply-to
Content
On my newish macOS laptop using Python 3.6 or 3.7, a no-op script takes 3 times as long to invoke using the entry_points machinery as it does to invoke directly. Here are some exemplary times (best times after several tries).

$ time python3.6 entrypoint.py 

real	0m0.047s
user	0m0.033s
sys	0m0.010s

$ time python3.6 /Library/Frameworks/Python.framework/Versions/3.6/bin/entrypoint

real	0m0.153s
user	0m0.129s
sys	0m0.020s

In this example, entrypoint.py consists of `def main(): pass`; the second script is that generated by `pip3 install ...`. I have confirmed that the `-e` flag to pip is not the culprit.

I look at a cprofile trace of the invocation and I do not see an obvious single culprit, but I'm not an expert at reading such traces either.

I know that there has been some previous debate about "how slow is slow", whether to try to improve import times, etc. I'm not trying to fan any flames here, but from a practical perspective, this discrepancy is showing up in developer tools that I'm writing, and is driving me to abandon entry_points in favor of less standard, less cross-platform install hackery in my setup.py scripts. An extra 0.1s per invocation is visibly detrimental to shell scripts calling out to installed python programs.
History
Date User Action Args
2018-06-19 14:34:17gwksetrecipients: + gwk
2018-06-19 14:34:17gwksetmessageid: <1529418857.83.0.56676864532.issue33902@psf.upfronthosting.co.za>
2018-06-19 14:34:17gwklinkissue33902 messages
2018-06-19 14:34:17gwkcreate