Antoine Pitrou <pit...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue33597>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to