Message319971
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. |
|
Date |
User |
Action |
Args |
2018-06-19 14:34:17 | gwk | set | recipients:
+ gwk |
2018-06-19 14:34:17 | gwk | set | messageid: <1529418857.83.0.56676864532.issue33902@psf.upfronthosting.co.za> |
2018-06-19 14:34:17 | gwk | link | issue33902 messages |
2018-06-19 14:34:17 | gwk | create | |
|