Speeding up Python's exit

Neil Cerutti neilc at norwich.edu
Thu Feb 28 12:02:52 EST 2013


On 2013-02-28, Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> Can anyone explain why this was so painfully slow, and what (if
> anything) I can do to avoid it in the future?

I think your explanation makes sense. Maybe the nested nature of
the strings was causing it to churn looking for circular
references?

Disabling gc before exiting might do the trick, assuming you're
assiduously managing other resources with context managers.

gc.disable()
exit()


-- 
Neil Cerutti



More information about the Python-list mailing list