Oops, this optimization broke trace module.
I reverted a part of the optimization. Current benchmark is:
$ ./python-patched -m perf timeit --compare-to ./python-master -s "import gc, doctest, ftplib, asyncio, email, http.client, pydoc, pdb, fractions, decimal, difflib, textwrap, statistics, shutil, shelve, lzma, concurrent.futures, telnetlib, smtpd, trace, distutils, pkgutil, tabnanny, pickletools, dis, argparse" "gc.collect()"
python-master: ..................... 1.63 ms +- 0.04 ms
python-patched: ..................... 1.64 ms +- 0.01 ms
Mean +- std dev: [python-master] 1.63 ms +- 0.04 ms -> [python-patched] 1.64 ms +- 0.01 ms: 1.01x slower (+1%) |