Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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: UNSURE 0.253 X-Spam-Level: ** X-Spam-Evidence: '*H*': 0.53; '*S*': 0.03; '(even': 0.05; 'memory.': 0.07; 'url:blog': 0.10; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ios': 0.16; 'limit,': 0.16; 'lying.': 0.16; 'malloc': 0.16; 'opposite': 0.16; 'prefix,': 0.16; 'segment': 0.16; 'language': 0.16; 'wrote:': 0.18; '(the': 0.22; 'code,': 0.22; 'memory': 0.22; 'programming': 0.22; "aren't": 0.24; 'days,': 0.24; 'earlier': 0.24; 'question': 0.24; 'post': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; 'message-id:@mail.gmail.com': 0.30; 'usually': 0.31; 'initialized': 0.31; 'though.': 0.31; 'url:05': 0.31; 'url:category': 0.31; 'file': 0.32; 'run': 0.32; 'quite': 0.32; 'maybe': 0.34; 'could': 0.34; "can't": 0.35; 'agree': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'data,': 0.36; 'url:org': 0.36; 'clear': 0.37; 'sometimes': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'bad': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'ensure': 0.60; 'skip:u 10': 0.60; 'eventually': 0.60; 'free': 0.61; 'impact': 0.61; 'first': 0.61; "you'll": 0.62; 'total': 0.65; 'due': 0.66; 'url:png': 0.68; 'jul': 0.74; 'yourself': 0.78; 'verification': 0.83; '.com': 0.84; '2gb': 0.84; 'devoted': 0.84; 'ease.': 0.84; 'firing': 0.84; 'level"': 0.84; 'lived': 0.84; 'random,': 0.84; 'url:2013': 0.84; 'costs,': 0.91; 'severe': 0.91; 'url:mozilla': 0.91; 'url:wp-content': 0.91; 'ultimate': 0.93; '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=bsx7tuPfRWLV4KsbWMbPqJ/sf1CS71j4jwnqb19+RIc=; b=eLW8uOf2fXS4AxdUx+kDj1PQRAKo5+OF+xhDzo0TcHfvpK0a2AqKsBoBKq0l1KWWSI /6AyjHjNMpt7q9Jq4DEDL09wP6v9G3mvW73Mal0hpuXgnw85FkpIWA6Clp0s7K3VR4ve GPoecXxF05ecSnPmsWO0sLWMBO5B7EzIsHNunfqLeXFzptuims2uHepdkTrPhAnrm/tJ gd5ZIfx6u1DB2rh8VJJ2GMwUwSicS3QUxxDvqIMfKtYAqpowQq4jpUS/ZiCjz+ijuJjP qVNDLiQhBb7QhxqrEw1y04E/XxD9nlm6arOSwK7pMKFaaVYXipAdou3qJW7PZjJG2ezY GLHw== MIME-Version: 1.0 X-Received: by 10.220.43.19 with SMTP id u19mr7556640vce.3.1375052834054; Sun, 28 Jul 2013 16:07:14 -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: Mon, 29 Jul 2013 00:07:13 +0100 Subject: Re: RE Module Performance From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Mon, 29 Jul 2013 09:27:00 +0200 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375082822 news.xs4all.nl 15937 [2001:888:2000:d::a6]:50725 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51425 On Sun, Jul 28, 2013 at 11:14 PM, Joshua Landau wrote: > GC does have sometimes severe impact in memory-constrained environments, > though. See http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/, > about half-way down, specifically > http://sealedabstract.com/wp-content/uploads/2013/05/Screen-Shot-2013-05-14-at-10.15.29-PM.png. > > The best verification of these graphs I could find was > https://blog.mozilla.org/nnethercote/category/garbage-collection/, although > it's not immediately clear in Chrome's and Opera's case mainly due to none > of the benchmarks pushing memory usage significantly. > > I also don't quite agree with the first post (sealedabstract) because I get > by *fine* on 2GB memory, so I don't see why you can't on a phone. Maybe IOS > is just really heavy. Nonetheless, the benchmarks aren't lying. The ultimate in non-managed memory (the opposite of a GC) would have to be the assembly language programming I did in my earlier days, firing up DEBUG.EXE and writing a .COM file that lived inside a single 64KB segment for everything (256-byte Program Segment Prefix, then code, then initialized data, then uninitialized data and stack), crashing the computer with remarkable ease. Everything "higher level" than that (even malloc/free) has its conveniences and its costs, usually memory wastage. If you malloc random-sized blocks, free them at random, and ensure that your total allocated size stays below some limit, you'll still eventually run yourself out of memory. This is unsurprising. The only question is, how bad is the wastage and how much time gets devoted to it? ChrisA