Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40138

Re: Speeding up Python's exit

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Neil Cerutti <neilc@norwich.edu>
Newsgroups comp.lang.python
Subject Re: Speeding up Python's exit
Date 28 Feb 2013 17:02:52 GMT
Organization Norwich University
Lines 17
Message-ID <ap9gtsFs187U1@mid.individual.net> (permalink)
References <512f8aa9$0$30001$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace individual.net ZDkh7uKiYLaU0W74ftIxkQJbBgjrtPbmjgaVI2qjxJIT4xLLA5SLpyatge1eiNHa2P
Cancel-Lock sha1:rf0bjJJ2Gs/wCMYF9fk8izaSlMs=
User-Agent slrn/0.9.9p1/mm/ao (Win32)
Xref csiph.com comp.lang.python:40138

Show key headers only | View raw


On 2013-02-28, Steven D'Aprano <steve+comp.lang.python@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Speeding up Python's exit Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-28 16:49 +0000
  Re: Speeding up Python's exit Neil Cerutti <neilc@norwich.edu> - 2013-02-28 17:02 +0000
  Re: Speeding up Python's exit Chris Angelico <rosuav@gmail.com> - 2013-03-01 04:06 +1100
  Re: Speeding up Python's exit Chris Angelico <rosuav@gmail.com> - 2013-03-01 04:33 +1100
  Re: Speeding up Python's exit Devin Jeanpierre <jeanpierreda@gmail.com> - 2013-02-28 12:33 -0500
  Re: Speeding up Python's exit Devin Jeanpierre <jeanpierreda@gmail.com> - 2013-02-28 12:31 -0500
  Re: Speeding up Python's exit Grant Edwards <invalid@invalid.invalid> - 2013-03-01 01:17 +0000
    Re: Speeding up Python's exit Antoine Pitrou <solipsis@pitrou.net> - 2013-03-01 19:10 +0000
    Re: Speeding up Python's exit Dave Angel <davea@davea.name> - 2013-03-01 14:17 -0500
    Re: Speeding up Python's exit Antoine Pitrou <solipsis@pitrou.net> - 2013-03-01 22:51 +0000
      Re: Speeding up Python's exit Ross Ridge <rridge@csclub.uwaterloo.ca> - 2013-03-03 18:27 -0500
    Re: Speeding up Python's exit Jason Swails <jason.swails@gmail.com> - 2013-03-01 21:51 -0500
  Re: Speeding up Python's exit Antoine Pitrou <solipsis@pitrou.net> - 2013-03-01 14:59 +0000

csiph-web