[issue19218] Use of MutableMapping in os module slows down interpreter startup
R. David Murray added the comment: For backward compatibility, shouldn't import _collections_abc in the __init__ file be import _collections_abc as abc ? -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
R. David Murray added the comment: Opened issue 20784 to address the above. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Raymond Hettinger added the comment: Christian, go ahead an rearrange the collections module. Move Lib/collections/abc.py to Lib/_collections_abc.py. Also, be sure to update source link on line 18 of Doc/library.collections.abc.rst -- assignee: rhettinger - christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Roundup Robot added the comment: New changeset 0b6052f2a8ee by Christian Heimes in branch 'default': Issue #19218: Rename collections.abc to _collections_abc in order to speed up interpreter start http://hg.python.org/cpython/rev/0b6052f2a8ee New changeset 7ea831581af4 by Christian Heimes in branch 'default': Issue #19218: Add facade collections.abc http://hg.python.org/cpython/rev/7ea831581af4 New changeset 62b6ecd1e463 by Christian Heimes in branch 'default': Issue #19218: set __name__ of _collections_abc to collections.abc in order to fix tests and keep beautiful qualified names. http://hg.python.org/cpython/rev/62b6ecd1e463 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Christian Heimes added the comment: Thank you very much for your input and assistance! tip compared to v3.4.0a3: ### normal_startup ### Min: 0.506533 - 0.313627: 1.62x faster Avg: 0.582504 - 0.441796: 1.32x faster Significant (t=19.98) Stddev: 0.02397 - 0.04366: 1.8213x larger -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Eric Snow added the comment: Thanks, Christian. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Antoine Pitrou added the comment: -1 on such hacks. I much prefer the _abcoll approach. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
STINNER Victor added the comment: The collections module is loaded by the io module. You removed from collections.abc import MutableMapping from os.py. To be useful, you have also to rewrite the whole io module to remove all references to the collections.abc module, right? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Christian Heimes added the comment: The io module no longer imports collections.abc through the locale module. Eric, I'm with Antoine. Your patch is too much of a clever hack and uses tricks that are dark magic. _abcoll is much simpler and easier to understand. Plus it can be used from other modules, too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Eric Snow added the comment: Not a problem. It is most definitely a hack. :) I put in up as an alternative to rearranging the collections module, but agree that doing so is preferable. I image that Raymond will make a decision on that one. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
New submission from Eric Snow: There has been some discussion on python-dev about improving interpreter startup time. Christian Heimes brought up how the os module imports collections (so _Environ can inherit from it) [1], and mentioned a couple of solutions [2]. [1]https://mail.python.org/pipermail/python-dev/2013-October/129312.html [2]https://mail.python.org/pipermail/python-dev/2013-October/129367.html -- components: Library (Lib) messages: 199402 nosy: christian.heimes, eric.snow priority: normal severity: normal stage: needs patch status: open title: Use of MutableMapping in os module slows down interpreter startup type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Eric Snow added the comment: Here is a patch for an alternate approach. It does not require re-implementing MutableMapping (could get out of sync) and does not require rearranging collections.abc. Instead it uses a metaclass to resolve the import issue lazily. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file32036/os-lazy-collections.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Christian Heimes added the comment: Nice trick :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Eric Snow added the comment: And when the lazy base class gets resolved, the metaclass gets to say You didn't see anything and I was never here. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19218] Use of MutableMapping in os module slows down interpreter startup
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com