Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!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: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'read.': 0.03; 'subject:Python': 0.06; 'subject:Questions': 0.07; 'alain': 0.09; 'calculating': 0.09; 'interpreted': 0.09; 'slow.': 0.09; 'sure,': 0.09; 'yeah,': 0.09; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ops': 0.16; 'wrote:': 0.18; 'implementing': 0.19; 'meant': 0.20; 'tend': 0.24; 'fairly': 0.24; '(or': 0.24; 'compiled': 0.26; 'equivalent': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'program,': 0.31; 'code': 0.31; 'that.': 0.31; 'minor': 0.31; 'probably': 0.32; 'fri,': 0.33; 'raw': 0.33; 'actual': 0.34; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'doing': 0.36; 'clear': 0.37; 'being': 0.38; 'depends': 0.38; 'nov': 0.38; 'to:addr :python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'easy': 0.60; 'hope': 0.61; "you're": 0.61; 'subject:. ': 0.67; 'close': 0.67; 'goal': 0.75; '1:18': 0.91; 'was:': 0.91; 'subject:2013': 0.95; '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=k3th2fstdq1GS37mGCuhQLBVHNK3x6fh1qzXrD8bmqM=; b=r4sIg+kQf6LhvKhG+P2LHaYh3mr/qd95lElV93TL+bITIvRvHyHW7gGB6VPc07WmD4 /2vHiClyxIf0ylQQB8Ix81VETj7GT9vCPqgS/7UuviQQ+3VgPdfKgQvyhEtQBaprg2/J DdvrWHzW2vMxVNAuEYRc+LBbkBpdFFxrEOAjVk7I4RiDzTEoQEhRIqcRkxjiug5XHqZd aK8NAzUikP/YWSkMPcIHRh4ca2vCqszaJq66XvRYdcTPxEm6m8CHcgcMm5cEvqzPLEaD IArubLljjPxEjmd8XkBzckVFSxEyd/2nei0Tv3/NBDQGip6d2fCrIta+7HFOYUadirV7 v5gA== MIME-Version: 1.0 X-Received: by 10.68.234.165 with SMTP id uf5mr2385017pbc.41.1383230725221; Thu, 31 Oct 2013 07:45:25 -0700 (PDT) In-Reply-To: <8738nhcymz.fsf@dpt-info.u-strasbg.fr> References: <877gctd1fn.fsf@dpt-info.u-strasbg.fr> <8738nhcymz.fsf@dpt-info.u-strasbg.fr> Date: Fri, 1 Nov 2013 01:45:25 +1100 Subject: Re: Basic Python Questions - Oct. 31, 2013 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383230734 news.xs4all.nl 15981 [2001:888:2000:d::a6]:39263 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58178 On Fri, Nov 1, 2013 at 1:18 AM, Alain Ketterlin wrote: > Well, sure, yes, I agree with you and hope they are left to the FP > engine (still, fp ops are often multi-cycle, but that's a minor point). > > But what I meant was: a (bytecode) interpreted program will always be > slower than a compiled program, probably by an order of magnitude when > doing number crunching. Yeah, but it depends on what your number crunching actually involves. If you're implementing crypto in Python, then yes, there's a lot of actual Python number crunching, and it's going to be slow. But calculating the cosine of 1.23456 is going to take very close to the same amount of time in each - the work isn't being done in Python. But yes, Python code does tend to be a lot slower than equivalent C. The goal of Python is not to lick (or even challenge) C for raw speed, but to be "fast enough", and to be easy to write and clear to read. It does a fairly good job at that. ChrisA