Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'resulting': 0.04; 'debugging': 0.07; 'utf-8': 0.07; 'string': 0.09; 'so?': 0.09; 'python': 0.11; '(which,': 0.16; 'behave': 0.16; 'blocks': 0.16; 'buggy': 0.16; 'count,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'garbage': 0.16; 'measurement': 0.16; 'segfault': 0.16; 'thread,': 0.16; 'unexpectedly': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'appears': 0.22; 'memory': 0.22; 'example': 0.22; 'saying': 0.22; 'certainly': 0.24; "shouldn't": 0.24; 'string,': 0.24; 'question': 0.24; 'this:': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; "doesn't": 0.30; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; 'crash': 0.31; 'delayed': 0.31; 'remotely': 0.31; 'run': 0.32; 'quite': 0.32; 'cases': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'next': 0.36; 'should': 0.36; 'performance': 0.37; 'sometimes': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'most': 0.60; "you've": 0.63; 'email addr:gmail.com': 0.63; 'kind': 0.63; 'real': 0.63; 'july': 0.63; 'more': 0.64; 'world': 0.66; 'attention.': 0.68; 'real-world': 0.68; 'jul': 0.74; 'search,': 0.74; 'topic,': 0.81; 'pardon': 0.84; 'usage.': 0.84; '2013': 0.98 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 :content-type; bh=DS4GAa9Ja3cgYZVpX16XdQ452t+Pe2jJNzNRuqljVMk=; b=WqfAEk5gARcbroqgwOgTfQ9Wj+6bz/D5QTjEYd8dow1Hn5EGMMzlUhxisuy/nffFXZ /LrseqN0n1bjcRfy4Q4wWrO+8+FcYEvqMbYSQlN/yQ5+aIgqevkBXSG5NXL+Lz312Wt2 VXjaktYrepoMQBhsiQTIzPzSeiBy+KZaunp8K5QmDeZmRKavoEH4br+amqVt8o8X3xmN fVVX59C0RQtH4Ex3OkKuB1j6hHhJmD+GyGe4aPA8A1Sn+qhWHER9E/3QWRYT1pXQwQKf uoZkpvfQ7RGOXin6Pf4MZ140oHqQVdxknZ9hXJW2wf4l2bENfRjI5G98jLxrF6qEAEvN bW9g== MIME-Version: 1.0 X-Received: by 10.220.11.79 with SMTP id s15mr4500214vcs.97.1375036195096; Sun, 28 Jul 2013 11:29:55 -0700 (PDT) In-Reply-To: References: <571a6dfe-fd66-42cf-92fc-8b97cbe6e9e4@googlegroups.com> <51DFDE65.5040001@Gmail.com> <4f1067f6-bc99-42ad-9166-37fb228b90e8@googlegroups.com> <51f14395$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f15e03$0$29971$c3e8da3$5496439d@news.astraweb.com> <8203e802-9dc5-44c5-9547-6e1947ee224b@googlegroups.com> <51F4DA25.3030304@rece.vub.ac.be> Date: Sun, 28 Jul 2013 19:29:54 +0100 Subject: Re: RE Module Performance 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.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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375036203 news.xs4all.nl 16003 [2001:888:2000:d::a6]:33807 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51394 On Sun, Jul 28, 2013 at 7:19 PM, Joshua Landau wrote: > On 28 July 2013 09:45, Antoon Pardon wrote: >> >> Op 27-07-13 20:21, wxjmfauth@gmail.com schreef: >>> >>> utf-8 or any (utf) never need and never spend their time >>> in reencoding. >> >> >> So? That python sometimes needs to do some kind of background >> processing is not a problem, whether it is garbage collection, >> allocating more memory, shufling around data blocks or reencoding a >> string, that doesn't matter. If you've got a real world example where >> one of those things noticeably slows your program down or makes the >> program behave faulty then you have something that is worthy of >> attention. > > > Somewhat off topic, but befitting of the triviality of this thread, do I > understand correctly that you are saying garbage collection never causes any > noticeable slowdown in real-world circumstances? That's not remotely true. If it's done properly, garbage collection shouldn't hurt the *overall* performance of the app; most of the issues with GC timing are when one operation gets unexpectedly delayed for a GC run (making performance measurement hard, and such). It should certainly never cause your program to behave faultily, though I have seen cases where the GC run appears to cause the program to crash - something like this: some_string = buggy_call() ... gc() ... print(some_string) The buggy call mucked up the reference count, so the gc run actually wiped the string from memory - resulting in a segfault on next usage. But the GC wasn't at fault, the original call was. (Which, btw, was quite a debugging search, especially since the function in question wasn't my code.) ChrisA