Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'sized': 0.07; 'observation': 0.09; 'python': 0.11; 'thread': 0.14; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'sorting': 0.16; 'sorts': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'sets': 0.30; 'subject:list': 0.30; "d'aprano": 0.31; 'fast.': 0.31; 'steven': 0.31; "i'd": 0.34; 'subject:from': 0.34; 'case,': 0.35; 'version': 0.36; 'data,': 0.36; 'charset:us- ascii': 0.36; 'two': 0.37; 'list': 0.37; 'performance': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'algorithms': 0.60; 'new': 0.61; 'received:50.22': 0.84 Date: Thu, 12 Dec 2013 06:04:54 -0600 From: Tim Chase To: python-list@python.org Subject: Re: min max from tuples in list In-Reply-To: <52a9a1a0$0$29992$c3e8da3$5496439d@news.astraweb.com> References: <52a9a1a0$0$29992$c3e8da3$5496439d@news.astraweb.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com 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: 1386849829 news.xs4all.nl 2886 [2001:888:2000:d::a6]:37931 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61700 On 2013-12-12 11:44, Steven D'Aprano wrote: > In any case, sorting in Python is amazingly fast. You may be > pleasantly surprised that a version that sorts your data, while > nominally O(N log N), may be much faster than an O(N) solution that > doesn't require sorted data. If I were a betting man, I'd be > willing to wager a shiny new dollar[1] that sorting works out > faster for reasonable sized sets of data. An interesting observation given the "Optimizing list processing" thread you recently opened about algorithms for processing large volumes of data and finding that elbow where two algorithms cross on the performance graph. :-) -tkc