[issue13351] Strange time complexity when creating nested lists

Antoine Pitrou report at bugs.python.org
Sun Nov 6 02:09:54 CET 2011


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

It's because of the cyclic garbage collector. If you call gc.disable() at the beginning of your benchmark, you'll see that runtimes get more similar in both cases.
You can also use tuples instead of lists as much as possible, it will reduce pressure on the GC.

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13351>
_______________________________________


More information about the Python-bugs-list mailing list