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


Groups > comp.lang.python > #40145

Re: Speeding up Python's exit

Return-Path <jeanpierreda@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.04; 'subject:Python': 0.05; 'called.': 0.09; 'garbage': 0.09; 'references.': 0.09; 'cc:addr:python-list': 0.10; '__del__': 0.16; 'called,': 0.16; 'collected.': 0.16; 'cyclic': 0.16; 'dummy': 0.16; 'early.': 0.16; 'run.': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'feb': 0.19; 'module': 0.19; 'putting': 0.20; 'sorry,': 0.22; 'posted': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'cycles': 0.29; 'necessary,': 0.29; 'probably': 0.29; 'class': 0.29; 'stuff': 0.30; 'gets': 0.32; "aren't": 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'but': 0.36; "wasn't": 0.36; 'method': 0.36; 'too': 0.36; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'called': 0.39; 'your': 0.60; 'different': 0.63; '2013': 0.84; 'trick,': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=xgobgWuKa7c3OUfUDvl3toYaJxK8oOQd77kx0mOxBo8=; b=0EDw3K3P5hdmMuYeC13ji0nptNAZeSd/eOH0ndIIbkXFjSDYS/jGNxR6jdIyjVweKS W8x7SfDD8iCz7/lTzqoMvO/W70WLvW5nDyDkB6wKLqvgwt59A9vpf9kUgh7T6cWJPEtC XXwNEF2xVEnW1HpCXm+jEgEbQ0uLNmSZJxQjVOLKhTnfLhE2z12tXI2XCgkok2l+a4WK Qfq6hMqnOAARRpiWdzB/5l0Pd9x601liOm30x/fLisGxNxlQUQhhAkXV0yjayqwh0S6C mtlbUu2m+HnDJMsDbtLpWYVkMTRkmHFn4F9yWBJWNwq4IvfQOol5wUrsZoDxN1fyB9HV o1jQ==
X-Received by 10.220.151.144 with SMTP id c16mr2835899vcw.18.1362072823711; Thu, 28 Feb 2013 09:33:43 -0800 (PST)
MIME-Version 1.0
In-Reply-To <CABicbJ+ZFVJpeV8u4kWJngChbDZZDq+zV3dAmRVJdLEFz7Gy7Q@mail.gmail.com>
References <512f8aa9$0$30001$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmrCa6K49m5--UU61S-PMrYayBvdhjqu_OPzkq=f0eFWOQ@mail.gmail.com> <CABicbJ+ZFVJpeV8u4kWJngChbDZZDq+zV3dAmRVJdLEFz7Gy7Q@mail.gmail.com>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date Thu, 28 Feb 2013 12:33:02 -0500
Subject Re: Speeding up Python's exit
To Chris Angelico <rosuav@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2657.1362072834.2939.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1362072834 news.xs4all.nl 6959 [2001:888:2000:d::a6]:32828
X-Complaints-To abuse@xs4all.nl
Path csiph.com!usenet.pasdenom.info!news.franciliens.net!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Xref csiph.com comp.lang.python:40145

Show key headers only | View raw


On Thu, Feb 28, 2013 at 12:31 PM, Devin Jeanpierre
<jeanpierreda@gmail.com> wrote:
> On Thu, Feb 28, 2013 at 12:06 PM, Chris Angelico <rosuav@gmail.com> wrote:
>> Is it any different if you create a deliberate reference loop and then
>> stuff it into some module somewhere? That would force it to be kept
>> until interpreter shutdown, and then a cyclic garbage collection after
>> that, which quite probably would be never run. A stupid trick,
>> perhaps, but it might work; I tested it with a dummy class with a
>> __del__ method and it wasn't called. Putting it into some other module
>> may not be necessary, but I don't know what happens with the
>> interactive interpreter and what gets freed up when.
>
> __del__ is never called for cyclic references.

Sorry, I posted too early. Not only is __del__ never called, but
__del__ is the reason the cycles aren't collected. I don't know if
your trick will work without __del__.

-- Devin

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