Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'subject:code': 0.07; 'dec': 0.15; 'investigate': 0.16; 'point!': 0.16; 'subject:dead': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'figures': 0.17; 'thanks.': 0.21; 'latter': 0.22; 'patch': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'wonder': 0.27; 'propose': 0.27; 'noticed': 0.28; '+0100,': 0.29; 'maybe': 0.29; 'that.': 0.30; 'function': 0.30; '(and': 0.32; 'to:addr:python-list': 0.33; 'same.': 0.35; 'subject:?': 0.35; 'received:org': 0.36; "didn't": 0.36; "i'll": 0.36; 'charset:us-ascii': 0.36; 'possible': 0.37; 'uses': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'content-disposition:inline': 0.60; 'remove': 0.61; 'between': 0.63; 'neil': 0.84; 'that)': 0.84 Date: Wed, 5 Dec 2012 18:19:29 +0100 From: Bruno Dupuis To: python-list@python.org Subject: Re: why does dead code costs time? References: <20121205164051.GF10865@hud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121205164051.GF10865@hud> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1354727963 news.xs4all.nl 6936 [2001:888:2000:d::a6]:58308 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34296 On Wed, Dec 05, 2012 at 05:40:51PM +0100, Bruno Dupuis wrote: > On Wed, Dec 05, 2012 at 04:15:59PM +0000, Neil Cerutti wrote: > > Maybe it's the difference between LOAD_CONST and LOAD_GLOBAL. We > > can wonder why g uses the latter. > > Good point! I didn't even noticed that. It's weird... Maybe the > difference comes from a peehole optim on f which is not possible on g as > g is to complex. > Neil, you were right, thanks. I patched peehole.c to remove this optim, and now the figures are the same. I investigate to find out why the latter function is not optimized the same way (and if it can be, I'll propose a patch for that) -- Bruno Dupuis