[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-12-16 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-12-12 Thread STINNER Victor
STINNER Victor added the comment: "The real question for me is: why are you interested in speeding up the import of the operator module? 200 µs won't make a visible difference." Alone, the gain is useless, but it's like the work done in Python 3.4 to avoid loading some modules at startup. The o

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread Stefan Krah
Stefan Krah added the comment: I understand the desire to speed things up, but either the four-line facade module or else a single module is probably required by PEP-399. -- title: operator.py: move the Python implementation in the else block of try/except ImportError -> operator.py: m

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > "import operator" is only 2x faster (289 usec => 136 usec). It's less > interesting. The real question for me is: why are you interested in speeding up the import of the operator module? 200 µs won't make a visible difference. > And what would be the purpose

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread STINNER Victor
STINNER Victor added the comment: > Why not: > > try: > from _operator import * > except ImportError: > from _pyoperator import * Let's try (I replaced operator.py with these 4 lines). $ ./python -m timeit "import sys; modname='operator'" "__import__(modname); del sys.modules[modname]

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Why not: try: from _operator import * except ImportError: from _pyoperator import * -- nosy: +pitrou ___ Python tracker ___ __

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-28 Thread STINNER Victor
STINNER Victor added the comment: Without the patch: $ ./python -m timeit "import sys; modname='operator'" "__import__(modname); del sys.modules[modname]" 1000 loops, best of 3: 289 usec per loop $ ./python -m timeit "import sys; modname='_operator'" "__import__(modname); del sys.modules[mod

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-28 Thread STINNER Victor
STINNER Victor added the comment: > Another option is to add a _pyoperator module. Attached builtin_operator.patch patch implements this option: operator.c becomes the main operator module, _pyoperator is the pure Python implementation (don't use "from _operator import *" anymore). With the p

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-28 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file32404/builtin_operator_diff.patch ___ Python tracker ___ ___ Python-bugs-li

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-18 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-13 Thread Stefan Krah
Stefan Krah added the comment: To be fair, for the startup time I can't really detect any difference between importing _operator directly and the current setup. -- ___ Python tracker __

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-12 Thread Stefan Krah
Stefan Krah added the comment: Using the microbenchmark I get (standard version): ./python -m timeit "import sys; modname='operator'" "__import__(modname); del sys.modules[modname]" 1000 loops, best of 3: 460 usec per loop Victor's version: ./python -m timeit "import sys; modname='operator'"

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-11 Thread STINNER Victor
New submission from STINNER Victor: To speedup Python startup, it may be interesting to not create useless many functions and classes in operator.py: "from _operator import *" will remove them a few line later. What do you think of moving the Python implementation of the operator module insid