Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '(currently': 0.07; 'dictionary': 0.07; 'figures': 0.07; "(it's": 0.09; 'csv': 0.09; 'keys,': 0.09; 'loop.': 0.09; 'pm,': 0.11; 'seconds': 0.11; 'wrote:': 0.14; 'file).': 0.16; 'row': 0.16; 'rows': 0.16; 'subject:Pythonic': 0.16; 'mapping': 0.19; 'code': 0.22; 'header :In-Reply-To:1': 0.22; 'loop': 0.22; 'values': 0.23; 'keys': 0.23; 'testing,': 0.23; "i'm": 0.26; 'chris': 0.27; 'message- id:@mail.gmail.com': 0.28; 'subject:?': 0.29; 'fri,': 0.29; 'all.': 0.30; 'does': 0.31; 'to:addr:python-list': 0.32; 'options': 0.34; 'difference': 0.35; 'couple': 0.35; 'doing': 0.36; 'received:209.85': 0.37; 'apr': 0.38; 'steven': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'larger': 0.39; 'set': 0.39; 'to:addr:python.org': 0.39; 'could': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; 'might': 0.40; 'best': 0.60; 'increase': 0.61; '2011': 0.62; 'limit': 0.62; 'hundred': 0.74; 'million': 0.75; 'thousand': 0.83; '10:52': 0.84; 'postage': 0.84; 'received:209.85.218.46': 0.91; 'received:mail- yi0-f46.google.com': 0.91; 'smoke': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=A2oN6EjPNYdQ3Z2nNnC1tbR6GNInys5Nk/2f2OhRZmk=; b=W1gIim+ofDj9yWawmlOD7IBRm2z0VmCi14bEEncGNQdd9MQBe/gvJXOS/1SyvasGoi jm658Tw9oC60yn7g1/Rc7sTpGP8ARAWRW+R7J3iQc/76nA2R9W2u+HqgfGZWjAPP6/O2 /xnB5f4MqIzMv1XpMg2N4qz90NyCk3wa9M8Uw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=X+nttY32Lr1Ne10wBBQcJgHJT4Srj2ix+n1JxBro5JzKt2bfOxUT0g/O8Nv8OM+uSU hG94pQaKXrRsyEro9Om4PqawMnDwpQSuK03MOnxKoRYhuuZaqe0YV4AMHwsg6ySiXCO0 fpys9RXfmmYUYVVRnpr34fhjKbGRMQtSVRzfw= MIME-Version: 1.0 In-Reply-To: <4da83f8f$0$29986$c3e8da3$5496439d@news.astraweb.com> References: <4da7ae8a$0$29986$c3e8da3$5496439d@news.astraweb.com> <4da83f8f$0$29986$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 16 Apr 2011 01:35:37 +1000 Subject: Re: Pythonic infinite for loop? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 22 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302881747 news.xs4all.nl 65870 [::ffff:82.94.164.166]:47500 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3272 On Fri, Apr 15, 2011 at 10:52 PM, Steven D'Aprano wrote: > On Fri, 15 Apr 2011 13:58:22 +1000, Chris Angelico wrote: > >> The dictionary is potentially a lot larger than this particular set of >> values (it's a mapping of header:value for a row of a user-provided CSV >> file). Does this make a difference to the best option? (Currently I'm >> looking at "likely" figures of 60+ keys in the dictionary and 3-8 >> postage options to pick up, but both of those could increase >> significantly before production.) > > SIXTY keys? > > When you get to sixty thousand keys, it might take a few seconds to > process. This whole code is inside a loop that we took, in smoke testing, to a couple hundred million rows (I think), with the intention of having no limit at all. So this might only look at 60-100 headers, but it will be doing so in a tight loop. ChrisA