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 terry.reedy
Recipients terry.reedy
Date 2016-07-16.23:19:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468711156.27.0.318866145341.issue27534@psf.upfronthosting.co.za>
In-reply-to
Content
This issue continues #25507.  I still want to reduce the number of modules imported when run.py starts a user process and the time they require.  In the process, I expect to reduce the number of tkinter module imports that need to be reversed and thereby make parts of the #25507 fix unnecessary.

"New changeset 93d325c64104 by Terry Jan Reedy in branch 'default':
Issue #25507: Move 4 objects from pyshell to run and switch inports.
https://hg.python.org/cpython/rev/93d325c64104"

This commit for #25507 was not needed for the fix I eventually choose, but it reduced the size of sys.modules in the user process from 193 to 156.  I have since determined that it reduced the time for startup imports on my machine from .45 to .25 seconds.  I now regard it as the first patch for this issue.

The attached file was explained in msg270522.  This and similar refactorings should be done when or after I have otherwise revised the module and tests in question.

For a Windows build of repository 3.6, importing tkinter into a fresh python process increases len(sys.modules) from 41 to 65.  But run only imports tkinter so it can call _tkinter.tkapp().eval('update') in its interactive input loop.  If other indirect imports were eliminated, I suspect _tkinter could be imported instead.
History
Date User Action Args
2016-07-16 23:19:17terry.reedysetrecipients: + terry.reedy
2016-07-16 23:19:16terry.reedysetmessageid: <1468711156.27.0.318866145341.issue27534@psf.upfronthosting.co.za>
2016-07-16 23:19:16terry.reedylinkissue27534 messages
2016-07-16 23:19:16terry.reedycreate