Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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; 'debug': 0.07; 'interpreter.': 0.07; 'mouse': 0.07; 'puts': 0.07; 'highlighting': 0.09; 'marking': 0.09; 'percentage': 0.09; 'pixel': 0.09; 'api': 0.11; 'cc:addr:python-list': 0.11; 'python': 0.11; 'bug': 0.12; 'gui': 0.12; 'language.': 0.14; '25%': 0.16; 'editor,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'program?': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'examples': 0.20; 'written': 0.21; 'code,': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'certain': 0.27; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'easier': 0.31; 'text': 0.33; 'cases': 0.33; 'fri,': 0.33; 'core': 0.34; "i'd": 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'level': 0.37; 'recent': 0.39; 'changed': 0.39; 'how': 0.40; 'even': 0.60; 'most': 0.60; 'tell': 0.60; 'entire': 0.61; 'times': 0.62; 'complete': 0.62; 'high': 0.63; 'subject:This': 0.74; 'actions.': 0.84; 'calls,': 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=slgaJJ5GBBz2nsWImmKRjReeDqlMLqJQHWofeW8CBR0=; b=HxgEYrtVJR+Lka1B/NxN2ut7C2eVYRZp72yD9Ol0klybacsR1HKv94ULPbSF1f6uN+ bSdxFGvoEuPi9BSHcVWX8+BBUJls9ePbYeTD8vaFfFIK8+YgEx2Bir99e6q1juCwDfvO W1N0p/9FlZ1GEElRpaxZMir95+3CH/fLHE7foZ8zKXjPRUSsGZLz4b05c17B29s15RmX AsJ0+ylyH1pyN9ki4/7zJeVvtTalCkCZsivLISLZTCGfCkSUltEE1CCiJO2hOWtXdULS YWgCLsrORLMXvln+TzyiUfk/5ATjee10u6vrCiTYkJSPMU7vAMtdICh5lByvih61SMBn g6cg== MIME-Version: 1.0 X-Received: by 10.53.12.229 with SMTP id et5mr22745908vdd.32.1401983069469; Thu, 05 Jun 2014 08:44:29 -0700 (PDT) In-Reply-To: References: <8738fjkc2w.fsf@dpt-info.u-strasbg.fr> Date: Fri, 6 Jun 2014 01:44:29 +1000 Subject: Re: OT: This Swift thing From: Chris Angelico Cc: "python-list@python.org" 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401983077 news.xs4all.nl 2924 [2001:888:2000:d::a6]:42586 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72716 On Fri, Jun 6, 2014 at 12:10 AM, Sturla Molden wrote: > My experience is that only a small percentage of the CPU time is spent in > the Python interpreter. > [various examples ] > - If the response time in a GUI is below the limits of human perception, can > the user tell my Python program is slower than a C program? And I'd go further: With several of these examples (particularly this last one), contradictory examples are code smell at the level of the Mythbusters' Corvette. I've had a few times when a GUI program written in a high level language is perceptibly slow; the most recent example was complete proof of your assertion, because under certain circumstances it could saturate a CPU core - but generally it would be 25% in my code and 75% in Xorg. The bug was that it was redrawing a ridiculous amount of "stuff" that hadn't changed (and in a lot of cases wasn't even visible), in response to a sweep of user actions. (Imagine marking and highlighting text in your favourite editor, and every time you move the mouse a pixel across, the entire buffer gets redrawn.) So even when response time was appalling, most of the time was actually spent inside API calls, not my code. Given how much easier it is to debug Python code than C code, I'd say this puts the advantage squarely on the high level language. ChrisA