Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Mark Lawrence Newsgroups: comp.lang.python Subject: Re: Pyhon 2.x or 3.x, which is faster? Date: Thu, 10 Mar 2016 13:46:34 +0000 Lines: 31 Message-ID: References: <56df6761$0$1588$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de URXuIUHxzHlajplvEYMbJwznY441XAWKNzsADqNh8cuw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'static': 0.03; 'cpython': 0.05; 'from:addr:yahoo.co.uk': 0.05; 'pypy': 0.07; 'rewrite': 0.07; 'optimizing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:which': 0.09; 'python': 0.10; 'options.': 0.15; 'numpy': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'rewriting': 0.16; 'something.': 0.16; 'unchanged,': 0.16; 'wrote:': 0.16; 'language': 0.19; 'lawrence': 0.22; 'priorities': 0.22; 'previously': 0.24; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; 'chris': 0.26; 'url:moin': 0.27; 'actual': 0.28; 'subset': 0.29; 'handled': 0.29; 'program,': 0.29; 'url:wiki': 0.30; "we're": 0.30; 'code': 0.30; 'option': 0.31; 'another': 0.32; 'generally': 0.32; 'language.': 0.32; 'run': 0.33; 'url:python': 0.33; 'third': 0.33; 'done': 0.35; "isn't": 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'received:org': 0.37; 'why': 0.39; 'whatever': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'still': 0.40; 'charset:windows-1252': 0.62; 'skip:n 10': 0.62; 'more': 0.63; 'our': 0.64; 'improvement.': 0.66; 'price': 0.69; 'bulk': 0.76; '95%': 0.84; 'chrisa': 0.84; 'idiomatic': 0.84; 'pythonistas,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 80.234.129.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104519 On 10/03/2016 13:08, Chris Angelico wrote: > > When people want better performance out of a number-crunching Python > program, they have a few options. One is to rewrite their code in C or > Fortran or something. Another is to make small tweaks so the bulk of > the work is handled by numpy or Cython. A third is to keep their code > completely unchanged, but run it under PyPy instead of whatever they > were previously using (probably CPython). Generally, rewriting in > C/Fortran is generally a bad idea; you pay the price over the whole > application, when optimizing a small subset of it would give 99% of > the performance improvement. That's why actual CPython byte-code > interpretation performance isn't so critical; if we can change 5% of > the code so it uses numpy, we keep 95% of it in idiomatic Python, > while still having the bulk of the work done in Fortran. CPython has > other priorities than performance - not to say that "slow is fine", > but more that "slow and dynamic opens up possibilities that fast and > static precludes, so we're happy to pay the price for the features we > want". > > ChrisA > This should be the first option https://wiki.python.org/moin/PythonSpeed/PerformanceTips -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence