Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.183 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.64; '*S*': 0.01; 'objects,': 0.09; 'url:file': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'work,': 0.20; 'memory': 0.22; 'looks': 0.24; '15,': 0.26; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'probably': 0.32; 'url:python': 0.33; 'fri,': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'possible': 0.36; 'url:org': 0.36; 'being': 0.38; 'to:addr:python-list': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'ian': 0.60; 'removing': 0.60; 'filling': 0.78; '2015': 0.84; 'done:': 0.84; 'url:cpython': 0.84; '9:00': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=OH1bMax1L04izPY6UUQBgDPN7GHQg8BIVXoVLKspGzk=; b=L04rEugP7P38pw+pK6mlBlu1PzFw5dlLhswnGtW9jcOfwuaPiqkqGWLowu5yya0tOU YNG0bBkgibznYc4KSYBh6SdMUSdfEEAUR81q4K/T57yN/LEPvj9MgfajBIVNw0Mjp82S /or5LMLUpOymfZ8cfzK7xIIUyET8CN3bkwi4VPnTv33dYSUJHW3ClpojQik00CIqOHwG NBJVL6uFMBa+aRbGfOcbOxxVLQJUlUymvW2MhcM+Bzeciyi6TkNL2UNuE2Lq8JGoRZyX hTwbwRBNOwetSc9mscxfmo8ZDZsJgA8bFix+75TQzoW52/Z5oCgpItZWhvdn1FHxXbb8 gtaA== X-Received: by 10.50.30.105 with SMTP id r9mr43581533igh.11.1431702327030; Fri, 15 May 2015 08:05:27 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <7JN4x.37133$Q41.15375@fx25.am4> <6w35x.645690$I97.19867@fx31.am4> <874mnfunpn.fsf@elektro.pacujo.net> <87bnhmgqrx.fsf@elektro.pacujo.net> <87382yglmy.fsf@elektro.pacujo.net> <5555e9de$0$13007$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Fri, 15 May 2015 09:04:46 -0600 Subject: Re: Building CPython To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431702345 news.xs4all.nl 2945 [2001:888:2000:d::a6]:50552 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90680 On Fri, May 15, 2015 at 9:00 AM, Ian Kelly wrote: > On Fri, May 15, 2015 at 6:43 AM, Steven D'Aprano > wrote: >> How much time would it save? Probably very little. After all, unless the >> method call itself did bugger-all work, the time to create the method >> object is probably insignificant. But it's a possible optimization. > > An interesting alternative (if it's not already being done) might be > to maintain a limited free-list of method objects, removing the need > to allocate memory for one before filling it in with data. Looks like it is already being done: https://hg.python.org/cpython/file/e7c7431f91b2/Objects/methodobject.c#l7