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.

classification
Title: Windows installer: 'precompile standard library' option should pre-compile with -O and -OO
Type: enhancement Stage: resolved
Components: Installation, Windows Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: paul.moore, python-dev, steve.dower, tim.golden, zach.ware
Priority: low Keywords: patch

Created on 2015-09-14 05:01 by zach.ware, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
25102_1.patch steve.dower, 2015-09-14 18:53
Messages (6)
msg250625 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015-09-14 05:01
Since the default all-users install location is now Program Files and thus not world-writable and with the advent of optimization-tagged .pyc files, the 'precompile' option in the installer should also precompile with -O and -OO.
msg250658 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-09-14 13:03
Doesn't it? It's supposed to...
msg250672 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015-09-14 16:09
It doesn't appear to; my 'C:\Program Files\Python 3.5\Lib\__pycache__' is full of .pyc's, but none with an optimization tag.  To confirm with math rather than eyesight, according to 'dir' there are 168 files in Lib\, and 168 in Lib\__pycache__ rather than the expected 168*3.

For the record, I have not run this Python as a privileged user, so the contents of __pycache__ are not incidental; they were definitely created by the precompile option.
msg250684 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-09-14 17:01
Right, it's just doing the single pass.

You're proposing making a slow part of the install three times slower, correct? Just to confirm :)
msg250686 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015-09-14 17:09
Steve Dower added the comment:
> You're proposing making a slow part of the install three times slower, correct? Just to confirm :)

Indeed I am :).  Or extend the precompile options to let the user do whatever of the three they want.

The precompile option is meant as a startup time optimization.  -O and -OO are meant as (very slim) runtime optimizations; it only makes sense that people actually concerned enough to use -O/-OO would rather have their startup time optimized as well.

This is pretty low priority, though.
msg251367 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-23 00:01
New changeset 31b230e5517e by Steve Dower in branch '3.5':
Issue #25102: Windows installer does not precompile for -O or -OO.
https://hg.python.org/cpython/rev/31b230e5517e
History
Date User Action Args
2022-04-11 14:58:20adminsetgithub: 69289
2015-09-23 01:24:51steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-09-23 00:01:52python-devsetnosy: + python-dev
messages: + msg251367
2015-09-14 18:53:53steve.dowersetfiles: + 25102_1.patch
keywords: + patch
stage: patch review
2015-09-14 17:09:23zach.waresetpriority: normal -> low

messages: + msg250686
2015-09-14 17:01:24steve.dowersetmessages: + msg250684
2015-09-14 16:09:46zach.waresetmessages: + msg250672
2015-09-14 13:03:13steve.dowersetmessages: + msg250658
2015-09-14 05:01:16zach.warecreate