[issue33597] Compact PyGC_Head

Antoine Pitrou report at bugs.python.org
Thu May 31 10:50:39 EDT 2018


Antoine Pitrou <pitrou at free.fr> added the comment:

Here is a micro-benchmark of GC overhead:

* before:

$ ./python -m timeit -s "import gc, doctest, ftplib, asyncio, email, http.client, pydoc, pdb, fractions, decimal, difflib, textwrap, statistics, shutil, shelve, lzma, concurrent.futures, telnetlib, smtpd, tkinter.tix, trace, distutils, pkgutil, tabnanny, pickletools, dis, argparse" "gc.collect()"
100 loops, best of 5: 2.41 msec per loop

* after:

$ ./python -m timeit -s "import gc, doctest, ftplib, asyncio, email, http.client, pydoc, pdb, fractions, decimal, difflib, textwrap, statistics, shutil, shelve, lzma, concurrent.futures, telnetlib, smtpd, tkinter.tix, trace, distutils, pkgutil, tabnanny, pickletools, dis, argparse" "gc.collect()"
100 loops, best of 5: 2.52 msec per loop

So it's a 4% slowdown, but GC runs themselves are a minor fraction of usual programs' runtime, so I'm not sure that matters.  Though it would be better to test on an actual GC-heavy application.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33597>
_______________________________________


More information about the Python-bugs-list mailing list