Roundup Robot added the comment:
New changeset 75b5617b8dfc by Stefan Krah in branch 'default':
Issue #19232: Fix sys.modules lookup (--without-threads)
https://hg.python.org/cpython/rev/75b5617b8dfc
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
We could speed up the import further by not importing collections
in _decimal. That could be done once structseq fully implements
the namedtuple protocol (for DecimalTuple).
I suggest to close this issue. I guess that importing decimal is already fast
enough,
Stefan Krah added the comment:
I'm fine with closing this. The structseq issue is #1820.
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
versions: +Python 3.5 -Python 3.4
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 8bf51cf94405 by Stefan Krah in branch 'default':
Issue #19232: Speed up decimal import. Additionally, since _decimal is
http://hg.python.org/cpython/rev/8bf51cf94405
--
nosy: +python-dev
___
Python
Stefan Krah added the comment:
We could speed up the import further by not importing collections
in _decimal. That could be done once structseq fully implements
the namedtuple protocol (for DecimalTuple).
--
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
I would like to go ahead with this. As Antoine mentioned, most
people don't diagnose import problems, especially when they compare
Python 2 against Python 3.
As it turns out, the slowdown is even significant in a simple tcpserver
application that starts a Python
Stefan Krah added the comment:
About IDLE I can't say anything, but I'm not entirely sure if the
PEP-399 import method is easier to understand for users, see e.g.:
http://stackoverflow.com/questions/13194384/instantiate-decimal-class
I get the impression that the posters at first did not even
Antoine Pitrou added the comment:
OTOH I don't like moving code around either, so we can wait until
there's a demonstrated need for the speedup.
Keep in mind that people who have startup speed problems aren't
likely to open an issue on the tracker about it, let alone
diagnose it enough to put
Mark Dickinson added the comment:
Mark, Raymond: Would you support the change (__name__ hack and all)?
No objections here.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
Stefan Krah added the comment:
Antoine Pitrou rep...@bugs.python.org wrote:
You can apply it using hg import --no-commit, I think.
mercurial 2.1 throws an exception even though the patch was created with
that version. Now I upgraded to 2.7.2 and it works.
Rietveld also seems to choke on the
Raymond Hettinger added the comment:
I think we should save these sort of tricks only for modules imported during
startup.
Ideally, a user should expect that the code for the decimal module is in
decimal.py. Ideally, tools like IDLE's Open Module should be able to find
the source code using
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
New submission from Stefan Krah:
As discussed on python-dev, importing _decimal at the bottom of
decimal.py is about 9x slower than importing _decimal directly.
--
assignee: skrah
components: Extension Modules
messages: 199553
nosy: skrah
priority: normal
severity: normal
stage: needs
STINNER Victor added the comment:
I proposed something similar for issue #19229.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
___
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
___
Python-bugs-list
Eric V. Smith added the comment:
Remember that one reason for importing the C version at the bottom of the
python version is so that alternate implementations (PyPy, IronPython, Jython)
could provide partial versions of the C (or equivalent) versions. By importing
after the Python version,
Changes by Stefan Krah stefan-use...@bytereef.org:
--
keywords: +patch
Added file: http://bugs.python.org/file32060/issue19232.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
Stefan Krah added the comment:
Right, let's start collecting objections. :)
Mark, Raymond: Would you support the change (__name__ hack and all)?
Maciej: Is this approach a problem for PyPy?
--
nosy: +fijall, mark.dickinson, rhettinger
___
Python
Changes by Stefan Krah stefan-use...@bytereef.org:
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
STINNER Victor added the comment:
If the Python implementation is renamed to _pydecimal, I don't expect it to be
used in CPython. I never used _pyio in a real application, only for some tests
to debug. I don't think that we need the __name__ = 'decimal' hack. If you
really want to keep it,
Stefan Krah added the comment:
I guess if some of the pickling stuff get's rewritten, we can drop
__name__.
The other thing is that traditionally the types were decimal.Decimal
etc., so I'm not sure if it is good idea to have _decimal.Decimal and
_pydecimal.Decimal.
Of course adding __module__
STINNER Victor added the comment:
The other thing is that traditionally the types were decimal.Decimal
etc., so I'm not sure if it is good idea to have _decimal.Decimal and
_pydecimal.Decimal.
Why not renaming the _decimal module to decimal?
--
Stefan Krah added the comment:
_decimal already lies about its name (for pickling).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
___
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19232
___
___
Python-bugs-list mailing
Stefan Krah added the comment:
I can't apply the patch that was created with diff --git, so here is
another one that is less readable but applies.
--
Added file: http://bugs.python.org/file32066/issue19232-2.patch
___
Python tracker
Antoine Pitrou added the comment:
I can't apply the patch that was created with diff --git, so here is
another one that is less readable but applies.
You can apply it using hg import --no-commit, I think.
--
nosy: +pitrou
___
Python tracker
26 matches
Mail list logo