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'" "__import__(modname); del sys.modules[modname]" 1000 loops, best of 3: 355 usec per loop Importing _operator directly: ./python -m timeit "import sys; modname='_operator'" "__import__(modname); del sys.modules[modname]" 10000 loops, best of 3: 35.7 usec per loop Extrapolating from what I did with decimal, I guess a _pyoperator version could get down to something like 70 usec. ---------- nosy: +skrah _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19229> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com