Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '"this': 0.03; 'cpython': 0.05; 'sufficient': 0.05; 'that?': 0.05; '64-bit': 0.07; 'happen?': 0.09; 'sure,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'element,': 0.16; 'elements,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sorting.': 0.16; 'elements': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'figures': 0.19; 'feb': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'skip': 0.24; 'stick': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'gets': 0.27; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'fixed': 0.29; 'leave': 0.29; 'am,': 0.29; 'array': 0.29; 'absolute': 0.30; 'message- id:@mail.gmail.com': 0.30; '25,': 0.31; 'lists': 0.32; 'guess': 0.33; 'comment': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'shows': 0.36; 'list': 0.37; 'minimum': 0.38; 'problems': 0.38; 'machines': 0.38; 'massive': 0.38; 'space': 0.40; 'even': 0.60; 'moments': 0.68; 'eight': 0.74; 'million': 0.74; '2015': 0.84; 'presumably': 0.84; 'to:none': 0.92 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:cc :content-type; bh=QNnqgddCVoIWBDcuX+X/zu+QVNjyl9EFeMV9O3BShKs=; b=NQdW2ddjxmaTMN1nVqq9rXNatzA9ooHTqYb1PbvFvSKTZBSqiZse6fYkWpZfaXAk3m HzKyVBwLBroO2KGAyJIXOaTfaMay7w6HN3vdrMu4uvHgDy7ZZlQLh3N5oRTzLv1EFEp4 rcQoJzDutFCFSqYD7beSItkVjldcW8m3vjo3RnQME4ON0buD6CADDereRPwrFs7ZN5ue R0Fsy29pQlF+6v69xlGzWVCssigOzqV0X/ON/e7VWaHUgxQLcViCuo5i8on4MrLaxHk1 Cd6CMHSIDOoX0mrrnUb+1AHYmw9LN5N1NfUTpA5t3uSGgKxcXSOn5rrkfnzvthyCe6vP 6Y1Q== MIME-Version: 1.0 X-Received: by 10.107.128.219 with SMTP id k88mr1035630ioi.27.1424822872344; Tue, 24 Feb 2015 16:07:52 -0800 (PST) In-Reply-To: References: <1cf84559-3a63-4799-a879-ae8e513d387e@googlegroups.com> <54ED0B7E.7030801@mrabarnett.plus.com> Date: Wed, 25 Feb 2015 11:07:52 +1100 Subject: Re: Bug in timsort!? From: Chris Angelico Cc: Python Content-Type: text/plain; charset=UTF-8 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424822880 news.xs4all.nl 2900 [2001:888:2000:d::a6]:35857 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86363 On Wed, Feb 25, 2015 at 10:50 AM, Skip Montanaro wrote: > Even if/when we get to the point where machines can hold an array of > 2**49 elements, I suspect people won't be using straight Python to > wrangle them. Looking just at CPython, what is the absolute minimum storage space for a massive list like that? My guess is that a 64-bit CPython might get as good as eight bytes per element; playing around with smaller figures (up to circa a million elements) shows it ranging from 8 to 9 bytes per element, bottoming out at just a smidge over 8, presumably at the moments when there's no slack space (there's a fixed overhead, which gets diminishingly significant). So an array of 2**49 elements would take 2**52 bytes (4 petabytes) of storage - addressable, to be sure, but an awful lot to be sorting. Would it be sufficient to stick a comment into the source saying "This may have problems with lists in excess of 2**49 elements", and leave it until that's actually likely to happen? ChrisA