Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #90393
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <skip.montanaro@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; 'subject:not': 0.03; 'argument': 0.05; 'think,': 0.07; 'arguments': 0.09; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'bytecode': 0.16; 'func': 0.16; 'path.': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'nearly': 0.26; 'push': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'cases': 0.33; 'could': 0.34; 'case,': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'two': 0.37; '2015': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=s16SyRJ+vNpRbltqxNIz1sz+s99YB+i8Ce59kZO+DY8=; b=FqRSYhayzq+xjCuIBKYq/TuL8sCFljioKZKUZx1Zc40Ncvrg6o0xjvh8ZWD6B9Uk/Y V7FCjv+OYEtG8TpuH2zwXKFrnSEuSwhV4CYrQngXoMWcbg4/oLD5o5zmXdSgi3/714zC zvtfmt83VeQh8mXJy8NBXt5bRaiFO4wtZ3j6ynOw7b3R6C5iQoL1XaHkbIWHybNbX5d1 3/EIqex2oPS5wK+srtGjPGBT9lRNmL25GlE6Z+D1toc8s8XP69SUpjEdPtX52U6IYzvH kuTdCtqX8EOBcpbRS0S2OS2nZflVzASat5z3r4AbsLUslVQPZyn9ChK/MKQUhxD3JwCN mObQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.182.111.231 with SMTP id il7mr8499157obb.15.1431357219176; Mon, 11 May 2015 08:13:39 -0700 (PDT) |
| In-Reply-To | <zv34x.521800$lV1.472319@fx05.am4> |
| References | <554f2bb6$0$13011$c3e8da3$5496439d@news.astraweb.com> <fNP3x.641427$3i4.583649@fx29.am4> <555028d8$0$12997$c3e8da3$5496439d@news.astraweb.com> <8Y_3x.668959$LI3.568865@fx24.am4> <mailman.365.1431353538.12865.python-list@python.org> <zv34x.521800$lV1.472319@fx05.am4> |
| Date | Mon, 11 May 2015 10:13:39 -0500 |
| Subject | Re: Calling a function is faster than not calling it? |
| From | Skip Montanaro <skip.montanaro@gmail.com> |
| To | BartC <bc@freeuk.com> |
| Cc | Python <python-list@python.org> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.369.1431357228.12865.python-list@python.org> (permalink) |
| Lines | 11 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1431357228 news.xs4all.nl 2907 [2001:888:2000:d::a6]:56674 |
| X-Complaints-To | abuse@xs4all.nl |
| X-Received-Bytes | 3675 |
| X-Received-Body-CRC | 3727037533 |
| Xref | csiph.com comp.lang.python:90393 |
Show key headers only | View raw
On Mon, May 11, 2015 at 10:01 AM, BartC <bc@freeuk.com> wrote:
> (1) It has an extra argument ('code'), in addition to any normal arguments
> of func (0 in this case)
Which might well push execution down the unoptimized code path. Also,
ISTR that Steven's original timeit runs tacked on a standalone "eval ;
..." to the function call case, so the LOAD_GLOBAL bytecode would have
been done in the function call case as well. He was, I think, doing
what he could to make the two cases as nearly identical as he could.
Skip
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Calling a function is faster than not calling it? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-10 19:58 +1000
Re: Calling a function is faster than not calling it? Christian Gollwitzer <auriocus@gmx.de> - 2015-05-10 12:34 +0200
Re: Calling a function is faster than not calling it? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-11 01:04 +1000
Re: Calling a function is faster than not calling it? Peter Otten <__peter__@web.de> - 2015-05-10 12:43 +0200
Re: Calling a function is faster than not calling it? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-11 00:49 +1000
Re: Calling a function is faster than not calling it? Peter Otten <__peter__@web.de> - 2015-05-10 18:14 +0200
Re: Calling a function is faster than not calling it? Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-10 10:25 -0600
Re: Calling a function is faster than not calling it? Terry Reedy <tjreedy@udel.edu> - 2015-05-10 12:37 -0400
Re: Calling a function is faster than not calling it? BartC <bc@freeuk.com> - 2015-05-10 22:08 +0100
Re: Calling a function is faster than not calling it? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-11 13:58 +1000
Re: Calling a function is faster than not calling it? BartC <bc@freeuk.com> - 2015-05-11 10:50 +0100
Re: Calling a function is faster than not calling it? Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-11 09:12 -0500
Re: Calling a function is faster than not calling it? BartC <bc@freeuk.com> - 2015-05-11 16:01 +0100
Re: Calling a function is faster than not calling it? Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-11 10:13 -0500
Re: Calling a function is faster than not calling it? Tony the Tiger <tony@tiger.invalid> - 2015-05-15 01:35 +0000
Re: Calling a function is faster than not calling it? Stefan Behnel <stefan_ml@behnel.de> - 2015-05-11 08:11 +0200
Re: Calling a function is faster than not calling it? Piet van Oostrum <piet@vanoostrum.org> - 2015-06-22 23:49 +0200
csiph-web