Christian Heimes added the comment:
os_stat_statvfs_pickle.patch with comments and tests.
--
Added file: http://bugs.python.org/file32051/os_stat_statvfs_pickle2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
Roundup Robot added the comment:
New changeset 29c4a6a11e76 by Christian Heimes in branch 'default':
Issue #19209: Remove import of copyreg from the os module to speed up
http://hg.python.org/cpython/rev/29c4a6a11e76
--
nosy: +python-dev
___
Python
Christian Heimes added the comment:
Thanks for your help!
Python is down to 43 modules on Linux.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 89e405e6a7a9 by Christian Heimes in branch 'default':
Issue #19209: fix structseq test
http://hg.python.org/cpython/rev/89e405e6a7a9
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
Can't we modify the qualified name instead?
Attached os_stat_statvfs_pickle.patch implements this idea. IMO it's much
simpler because it removes completly the need of the copyreg module.
Example with the patch on Linux:
$ ./python
Python 3.4.0a3+
New submission from Christian Heimes:
The patch removes import copyreg from the os module and moves the
registration of the hooks to copyreg. This speeds up the startup of the
interpreter a tiny bit.
--
files: os_no_copyreg.patch
keywords: patch
messages: 199303
nosy: christian.heimes
Georg Brandl added the comment:
+1
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
___
___
Python-bugs-list mailing
STINNER Victor added the comment:
I don't know the copyreg module! Does it have a unit test for the registered os
objects? If not, how can it be tested manually?
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
Christian Heimes added the comment:
import os
import pickle
pickle.dumps(os.stat(.))
Serhiy Storchaka added the comment:
What will happen when do not register stat_result and statvfs_result at all?
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
Christian Heimes added the comment:
You can still pickle and unpickle the objects but the result is no longer
platform-independent as it refers to posix or nt instead of os.
import os, pickle, pickletools
pickletools.dis(pickle.dumps(os.stat(.)))
0: \x80 PROTO 3
2: cGLOBAL
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
___
___
Python-bugs-list mailing
STINNER Victor added the comment:
Can't we modify the qualified name instead?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
___
___
Georg Brandl added the comment:
But for pickling something, you have to import pickle, which always imports
copyreg anyway, doesn't it?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
Christian Heimes added the comment:
Exactly, the pickle module depends on the copyreg module. It's a submodule that
acts as a registry for pickle-related lookups and hooks. My patch just moves
the registration of these hooks out of the os module into the copyreg module.
--
Georg Brandl added the comment:
I don't see a problem with that.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
___
___
Python-bugs-list
Serhiy Storchaka added the comment:
How much this speed up the startup of the interpreter?
Proposed patch looks contrary to purpose of the copyreg module.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
Christian Heimes added the comment:
The speedup is minimal but it's a start.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
___
___
STINNER Victor added the comment:
os_no_copyreg.patch looks good to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19209
___
___
Serhiy Storchaka added the comment:
I don't think we should tangent code for such tiny benefit. copyreg is
lightweight module specially designed to break coupling of the code.
--
___
Python tracker rep...@bugs.python.org
20 matches
Mail list logo