Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #90063
| Path | csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.114 |
| X-Spam-Level | * |
| X-Spam-Evidence | '*H*': 0.77; '*S*': 0.00; 'algorithm': 0.04; 'algorithms,': 0.07; '0.1': 0.09; 'differently.': 0.09; 'measure': 0.09; 'run,': 0.09; 'snippet': 0.09; 'windows': 0.15; '1:08': 0.16; 'hits': 0.16; 'runs,': 0.16; 'scope,': 0.16; 'workstation': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'wed,': 0.18; 'machine': 0.22; '>>>': 0.22; 'memory': 0.22; 'load': 0.23; 'adds': 0.24; 'tells': 0.24; 'typical': 0.24; 'wednesday': 0.24; 'server.': 0.24; 'environment': 0.24; 'script': 0.25; 'compare': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'getting': 0.31; 'agreed.': 0.31; 'controlled': 0.31; "d'aprano": 0.31; 'lot.': 0.31; 'steven': 0.31; 'run': 0.32; 'linux': 0.33; 'running': 0.33; 'mac': 0.33; 'subject:the': 0.34; 'could': 0.34; "can't": 0.35; 'possible.': 0.35; 'computing': 0.35; 'equal': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'useful': 0.36; "i'll": 0.36; 'possible': 0.36; 'similar': 0.36; 'should': 0.36; 'example,': 0.37; 'virtual': 0.37; 'minimum': 0.38; 'server': 0.38; 'machines': 0.38; 'to:addr :python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'rather': 0.38; 'little': 0.38; 'environment.': 0.39; 'itself': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'algorithms': 0.60; 'ian': 0.60; 'tell': 0.60; 'profile': 0.61; 'skip:* 10': 0.61; 'simply': 0.61; 'such': 0.63; 'different': 0.65; 'within': 0.65; 'close': 0.67; 'frequently': 0.68; 'production.': 0.68; 'useful.': 0.68; 'potentially': 0.81; '2015': 0.84; 'alone,': 0.84; 'comparable': 0.84; 'day...': 0.84; 'high- end': 0.84; 'measure.': 0.84; 'min': 0.84; 'noise': 0.84; 'production;': 0.84; 'ram,': 0.84; 'results,': 0.84; 'besides,': 0.93; 'realistic': 0.93 |
| 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=r1RlV/v48xHXZWsZ0jYicq1UfDgcAqoWhRdYZdkI9J4=; b=xM6/fMbdpvgXTZbooY5hxYV2JinhMaoqh89z164IFFI8Ehw/VcSwkabD5JXLspFCXC nRN8yPnjxbpGUF4h0+X9ziCPld55QyJza0ycrO2Op+Cai/kiUEON0g5MkTQrbD4ig+oc xaOnwA+oKqtWMhRnwHpaQKqV+ymYHIKz1PbY5rMjyW7XXpNqTo34/0hK7YF6NAivrnh+ +KEKJgjWUqXwfI6ElR9ixTxWmLK1HB+PR+zvIG3NXMSx6JQLV9M4YlQT87mwdx/Z53Ka SUfysQs7gdvq8PLSgAWIyQOweDNk+yi7bBM1mZthJe2c1eRrSlZR6I+wFf9x/eYNBwyo QPWw== |
| X-Received | by 10.50.85.43 with SMTP id e11mr8964523igz.15.1430929105946; Wed, 06 May 2015 09:18:25 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <5549bde3$0$12911$c3e8da3$5496439d@news.astraweb.com> |
| References | <87h9rvm576.fsf@Equus.decebal.nl> <871tixlmp6.fsf@Equus.decebal.nl> <750db03b-e393-43ff-9ccf-5cc050af7324@googlegroups.com> <87zj5jf15q.fsf@Equus.decebal.nl> <55490FAE.8070501@davea.name> <CALwzidmuhD0HhAZKRGMbgEgVVHf05_3pw=+o2JyAwWdiOtcNNA@mail.gmail.com> <55492F55.1020105@davea.name> <mailman.142.1430861087.12865.python-list@python.org> <55496de5$0$12993$c3e8da3$5496439d@news.astraweb.com> <mailman.158.1430891975.12865.python-list@python.org> <5549bde3$0$12911$c3e8da3$5496439d@news.astraweb.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Wed, 6 May 2015 10:17:45 -0600 |
| Subject | Re: Throw the cat among the pigeons |
| To | 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.181.1430929108.12865.python-list@python.org> (permalink) |
| Lines | 50 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1430929108 news.xs4all.nl 2858 [2001:888:2000:d::a6]:48760 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:90063 |
Show key headers only | View raw
On Wed, May 6, 2015 at 1:08 AM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > On Wednesday 06 May 2015 15:58, Ian Kelly wrote: > >> On Tue, May 5, 2015 at 7:27 PM, Steven D'Aprano >> <steve+comp.lang.python@pearwood.info> wrote: >>> Only the minimum is statistically useful. >> >> I disagree. The minimum tells you how fast the code *can* run, under >> optimal circumstances. The mean tells you how fast it *realistically* >> runs, under typical load. Both can be useful to measure. > > Er, not even close. Running code using timeit is in no way the same as > running code "for real" under realistic circumstances. The fact that you are > running the function or code snippet in isolation, in its own scope, via > exec, rather than as part of some larger script or application, should be a > hint. timeit itself has overhead, so you cannot measure the time taken by > the operation alone, you can only measure the time taken by the operation > within the timeit environment. We have no reason to think that the > distribution of noise under timeit will be even vaguely similar to the noise > when running in production. You also can't be sure that the base time taken by the operation in your development environment will be comparable to the time taken in production; different system architectures may produce different results, and what is faster on your workstation may be slower on a server. Also, different algorithms may react to load differently. For example, an algorithm that goes to different parts of memory frequently may start thrashing sooner than an algorithm with better spatial locality if the system is paging a lot. I'll grant that just computing the means on a workstation that is not under a controlled load is not the best way to measure this -- but a difference in mean that is not simply proportional to the difference in min is still potentially useful information. > The purpose of timeit is to compare individual algorithms, in as close as > possible to an equal footing with as little noise as possible. If you want > to profile code used in a realistic application, use a profiler, not timeit. > And even that doesn't tell you how fast the code would be alone, because the > profiler adds overhead. > > Besides, "typical load" is a myth -- there is no such thing. A high-end > Windows web server getting ten thousand hits a minute, a virtual machine > starved for RAM, a Mac laptop, a Linux server idling away with a load of 0.1 > all day... any of those machines could run your code. How can you *possibly* > say what is typical? The very idea is absurd. Agreed.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Throw the cat among the pigeons Cecil Westerhof <Cecil@decebal.nl> - 2015-05-02 16:20 +0200
Re: Throw the cat among the pigeons Cecil Westerhof <Cecil@decebal.nl> - 2015-05-03 17:12 +0200
Re: Throw the cat among the pigeons Paul Moore <p.f.moore@gmail.com> - 2015-05-05 08:47 -0700
Re: Throw the cat among the pigeons Cecil Westerhof <Cecil@decebal.nl> - 2015-05-05 18:18 +0200
Re: Throw the cat among the pigeons Dave Angel <davea@davea.name> - 2015-05-05 14:45 -0400
Re: Throw the cat among the pigeons Cecil Westerhof <Cecil@decebal.nl> - 2015-05-05 21:42 +0200
Re: Throw the cat among the pigeons Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-06 12:57 +1000
Re: Throw the cat among the pigeons Chris Angelico <rosuav@gmail.com> - 2015-05-06 14:03 +1000
Re: Throw the cat among the pigeons Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-05 14:30 -0600
Re: Throw the cat among the pigeons Terry Reedy <tjreedy@udel.edu> - 2015-05-05 16:46 -0400
Re: Throw the cat among the pigeons Cecil Westerhof <Cecil@decebal.nl> - 2015-05-05 23:12 +0200
Re: Throw the cat among the pigeons Terry Reedy <tjreedy@udel.edu> - 2015-05-05 19:22 -0400
Re: Throw the cat among the pigeons Dave Angel <davea@davea.name> - 2015-05-05 17:00 -0400
Re: Throw the cat among the pigeons Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-05 15:23 -0600
Re: Throw the cat among the pigeons Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-06 11:27 +1000
Re: Throw the cat among the pigeons Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-05 23:58 -0600
Re: Throw the cat among the pigeons Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-06 17:08 +1000
Re: Throw the cat among the pigeons Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-06 10:17 -0600
Re: Throw the cat among the pigeons Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-06 21:23 +0100
Re: Throw the cat among the pigeons Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-05 15:39 -0600
Re: Throw the cat among the pigeons Dave Angel <davea@davea.name> - 2015-05-05 17:55 -0400
Re: Throw the cat among the pigeons Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-06 12:19 +1000
Re: Throw the cat among the pigeons Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-06 14:05 +1000
Re: Throw the cat among the pigeons Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-06 16:26 +1000
Re: Throw the cat among the pigeons Dave Angel <davea@davea.name> - 2015-05-06 09:12 -0400
Re: Throw the cat among the pigeons Dan Sommers <dan@tombstonezero.net> - 2015-05-07 03:16 +0000
Re: Throw the cat among the pigeons Chris Angelico <rosuav@gmail.com> - 2015-05-06 23:55 +1000
Re: Throw the cat among the pigeons Dave Angel <davea@davea.name> - 2015-05-06 10:22 -0400
Re: Throw the cat among the pigeons Paul Rubin <no.email@nospam.invalid> - 2015-05-06 08:12 -0700
Re: Throw the cat among the pigeons Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-05-06 17:36 +0200
Re: Throw the cat among the pigeons Dave Angel <davea@davea.name> - 2015-05-06 16:23 -0400
Re: Throw the cat among the pigeons Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-05-07 11:14 +0200
Re: Throw the cat among the pigeons Chris Angelico <rosuav@gmail.com> - 2015-05-07 19:38 +1000
Re: Throw the cat among the pigeons Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-06 09:47 -0600
Re: Throw the cat among the pigeons Paul Rubin <no.email@nospam.invalid> - 2015-05-06 10:24 -0700
csiph-web