[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
INADA Naoki added the comment: New changeset ba9ddb7eea39a651ba7f1ab3eb012e4129c03620 by INADA Naoki in branch 'master': bpo-29585: fix test fail on macOS Framework build (GH-2928) https://github.com/python/cpython/commit/ba9ddb7eea39a651ba7f1ab3eb012e4129c03620 --

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
Changes by INADA Naoki : -- pull_requests: +2980 ___ Python tracker ___ ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
INADA Naoki added the comment: https://github.com/python/cpython/pull/136/files -if sys.platform == 'darwin': -from sysconfig import get_config_var -if get_config_var('PYTHONFRAMEWORK'): -USER_SITE = get_path('purelib', 'osx_framework_user') -

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread INADA Naoki
INADA Naoki added the comment: https://docs.python.org/3.6/library/site.html#site.USER_SITE > ~/Library/Python/X.Y/lib/python/site-packages for Mac framework builds So it seems I broke sysconfig.get_path('purelib', 'posix_user'). -- ___ Python

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread Ned Deily
Ned Deily added the comment: New changeset c22bd58d933efaec26d1f77f263b2845473b7e15 by Ned Deily in branch 'master': bpo-28095: Re-enable temporarily disabled part of test_startup_imports on macOS (#2927) https://github.com/python/cpython/commit/c22bd58d933efaec26d1f77f263b2845473b7e15

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread Ned Deily
Changes by Ned Deily : -- pull_requests: +2979 ___ Python tracker ___ ___ Python-bugs-list

[issue29585] site.py imports relatively large `sysconfig` module.

2017-07-28 Thread Ned Deily
Ned Deily added the comment: test_get_path fails on macOS installed framework builds: == FAIL: test_get_path (test.test_site.HelperFunctionsTests) -- Traceback

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-29 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-29 Thread INADA Naoki
INADA Naoki added the comment: New changeset 6b42eb17649bed9615b6e6cecaefdb2f46990b2c by INADA Naoki in branch 'master': bpo-29585: Fix sysconfig.get_config_var("PYTHONFRAMEWORK") (GH-2483) https://github.com/python/cpython/commit/6b42eb17649bed9615b6e6cecaefdb2f46990b2c --

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-29 Thread INADA Naoki
Changes by INADA Naoki : -- pull_requests: +2542 ___ Python tracker ___ ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset b01c574ad6d796025152b5d605eceb7816e6f7a7 by Victor Stinner in branch 'master': bpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h (#2477) https://github.com/python/cpython/commit/b01c574ad6d796025152b5d605eceb7816e6f7a7 --

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2532 ___ Python tracker ___ ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread STINNER Victor
STINNER Victor added the comment: Test fails on macOS: http://buildbot.python.org/all/builders/x86-64%20Sierra%203.x/builds/402/steps/test/logs/stdio == FAIL: test_getsitepackages (test.test_site.HelperFunctionsTests)

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2531 ___ Python tracker ___ ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread INADA Naoki
Changes by INADA Naoki : -- pull_requests: +2530 ___ Python tracker ___ ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-06-28 Thread INADA Naoki
INADA Naoki added the comment: New changeset a8f8d5b4bd30dbe0828550469d98f12d2ebb2ef4 by INADA Naoki in branch 'master': bpo-29585: optimize site.py startup time (GH-136) https://github.com/python/cpython/commit/a8f8d5b4bd30dbe0828550469d98f12d2ebb2ef4 --

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-20 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki
INADA Naoki added the comment: PR 136 now adds `sys._framework` and 'PYTHONFRAMEWORK' macro in pyconfig.h. -- ___ Python tracker ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +merwok ___ Python tracker ___ ___ Python-bugs-list

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki
INADA Naoki added the comment: I create #29592 for abs_paths(). Let's focus on sysconfig in this issue. PR 136 ports really needed part of sysconfig into site.py already. 'PYTHONFRAMEWORK' on macOS is the only variable we need import from sysconfig. Adding `site.cfg` like `pyvenv.cfg` make

Re: [issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread M.-A. Lemburg
On 17.02.2017 13:06, STINNER Victor wrote: >> Alternatively, sysconfig data could be made available via a C lookup >> function; with the complete dictionary only being created on demand. >> get_config_var() already is such a lookup API which could be used as >> front-end. > > I don't think

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki
INADA Naoki added the comment: no-site python_startup_no_site: Median +- std dev: 9.13 ms +- 0.02 ms default: python_startup: Median +- std dev: 15.6 ms +- 0.0 ms GH-136 + skip abs_paths(). python_startup: Median +- std dev: 14.2 ms +- 0.0 ms profile of GH-136 + skip abs_paths():

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki
INADA Naoki added the comment: FYI, here is profile of site: https://gist.github.com/methane/1f1fe4385dad84f03eb429359f0f917b -- ___ Python tracker ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Christian Heimes
Christian Heimes added the comment: Instead of _site, would it make sense to include the four vars in sys, perhaps as named structure like sys.flags? -- ___ Python tracker

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread STINNER Victor
STINNER Victor added the comment: Marc-Andre Lemburg added the comment: > I don't think rewriting party of site.py in C is a good idea. It's a rather > maintenance intense module. > > However, optimizing access is certainly something that's possible, e.g. by > placing the few variables that

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I don't think rewriting party of site.py in C is a good idea. It's a rather maintenance intense module. However, optimizing access is certainly something that's possible, e.g. by placing the few variables that are actually needed by site.py into a

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki
INADA Naoki added the comment: Christian: I'm using macOS on office and Linux on home. sysconfig is imported even on Linux https://github.com/python/cpython/blob/master/Lib/site.py#L247-L248 https://github.com/python/cpython/blob/master/Lib/site.py#L263-L271 --

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Christian Heimes
Christian Heimes added the comment: What's your platform, Inada? Are you running macOS? I optimized site.py for Linux and BSD users a couple of years ago. -- ___ Python tracker

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread STINNER Victor
STINNER Victor added the comment: Serhiy collected interesting numbers, copy/paste of this message: http://bugs.python.org/issue28637#msg280380 On my computer: Importing empty module: 160 us Creating empty class: 30 us Creating empty function: 0.16 us Creating empty Enum/IntEnum: 125/150 us

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread STINNER Victor
STINNER Victor added the comment: Instead of using slow sysconfig and loading the big _sysconfig_data dictionary in memory, would it be possible to extract the minimum set of sysconfig needed by the site module and put it in a builtin module? In site.py, I only found 4 variables: from

[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki
New submission from INADA Naoki: site.py uses sysconfig (and sysconfigdata, _osx_support) module for user-site package. But sysconfig module is not so lightweight, and very rarely used. Actually speaking, only tests and distutils uses sysconfig in stdlibs. And it takes about 7% of startup