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.
Created on 2015年01月16日 23:11 by steve.dower, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 23253.diff | steve.dower, 2015年01月17日 18:00 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg234151 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2015年01月16日 23:11 | |
Currently, pythonXY.dll has a dependency on shell32.dll solely for the os.startfile (Modules/posixmodule.c) function. This is quite a heavy dependency that many would rather not have to load (e.g. lightweight server configurations). It would be nice to delay load the DLL and fail the operation if it is not available. (This is as much a reminder for myself as anything else, but if someone wants to do it then feel free.) |
|||
| msg234183 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2015年01月17日 18:00 | |
Attached a patch. Comparing the time for "python.exe -c '0'" with Powershell's Measure-Command tool, it looks like there's a 3-4ms (~8-10%) improvement in startup time too. That's not at all robust, but it's certainly no worse. (I'm not surprised - shell32.dll is a horrendously big dependency and we're better off without it.) |
|||
| msg234199 - (view) | Author: Tim Golden (tim.golden) * (Python committer) | Date: 2015年01月17日 21:21 | |
I'm +0.75. I think the idea's fine in principle and the patch (by inspection) seems to do the right things. My only concerns are: that posixmodule.c becomes even longer and more involved; and that the benefit might not quite be great enough to justify the added complexity. |
|||
| msg234201 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2015年01月17日 22:00 | |
Yeah, I hate touching posixmodule.c for the same reason. It'd be nice to split it up into separate platform files, but nobody is volunteering for that. If you focus on the performance, then yeah, this change probably isn't worth it. OTOH, the number of Windows platforms keep increasing (e.g. ARM, phone/tablet/various sandboxes, etc.) and the fewer dependencies we have the more likely Python will Just Work in them. (And the more value that a split up posixmodule.c will have... guess it'll have to happen eventually.) |
|||
| msg234255 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2015年01月18日 16:06 | |
If you want a robust measurement of startup impact, the benchmark suite has two benchmarks specifically for startup (w/ and w/o site.py). |
|||
| msg234621 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2015年01月24日 16:49 | |
I assume you're referring to normal_startup and startup_nosite in perf.py at h.p.o/benchmarks? Handy to know about (I need to explore our top-level repos more often, obviously), but probably still not going to measure time in the Windows PE loader as accurately as it'd need to be to conclusively prove a speed advantage. I'd probably need to hit up the Windows team for some of their profiling tools to get good numbers here. Still, it's indisputable that this change will reduce the initial memory overhead, so I'll take Tim's 0.75 and run with it :) |
|||
| msg234622 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年01月24日 16:54 | |
New changeset 5bff604a864e by Steve Dower in branch 'default': Closes #23253: Delay-load ShellExecute https://hg.python.org/cpython/rev/5bff604a864e |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:11 | admin | set | github: 67442 |
| 2015年01月24日 16:54:29 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg234622 resolution: fixed stage: patch review -> resolved |
| 2015年01月24日 16:49:22 | steve.dower | set | messages: + msg234621 |
| 2015年01月18日 16:06:18 | brett.cannon | set | messages: + msg234255 |
| 2015年01月18日 16:05:27 | brett.cannon | set | nosy:
+ brett.cannon |
| 2015年01月17日 22:00:06 | steve.dower | set | messages: + msg234201 |
| 2015年01月17日 21:21:03 | tim.golden | set | messages:
+ msg234199 title: Delay-load ShellExecute[AW] in os.startfile -> Delay-load ShellExecute |
| 2015年01月17日 18:00:33 | steve.dower | set | assignee: steve.dower stage: patch review |
| 2015年01月17日 18:00:14 | steve.dower | set | files:
+ 23253.diff keywords: + patch messages: + msg234183 |
| 2015年01月16日 23:11:50 | steve.dower | create | |