Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'skip:[ 20': 0.04; 'cpython': 0.05; 'subject:Python': 0.06; 'debug': 0.07; 'ascii': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Why': 0.09; 'python': 0.11; 'language.': 0.14; '(int': 0.16; 'hardware.': 0.16; 'non-ascii': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:make': 0.16; 'win7': 0.16; 'bit': 0.19; 'machine': 0.22; '>>>': 0.22; 'import': 0.22; 'install': 0.23; 'header:User-Agent:1': 0.23; 'test.': 0.24; 'unicode': 0.24; 'non': 0.24; 'compiled': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'am,': 0.29; 'especially': 0.30; 'skip:( 20': 0.30; "skip:' 10": 0.31; '>>>>': 0.31; 'trivial': 0.31; 'languages': 0.32; 'run': 0.32; 'another': 0.32; 'test': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'received:173': 0.61; 'subject:more': 0.64; 'different': 0.65; 'road': 0.65; 'latest': 0.67; 'improvements': 0.68; 'respect': 0.70; 'repeat': 0.74; 'forth': 0.81; '3.3.1': 0.84; '3.4': 0.84; 'everything,': 0.84; 'received:fios.verizon.net': 0.84; 'subject:money': 0.84; 'timings': 0.84; '2013,': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Jan Reedy Subject: Re: Why do Perl programmers make more money than Python programmers Date: Tue, 07 May 2013 14:40:03 -0400 References: <5186aeb6$0$29997$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367952020 news.xs4all.nl 15907 [2001:888:2000:d::a6]:41655 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44898 On 5/7/2013 9:22 AM, jmfauth road forth on his dead hobbyhorse to hijack yet another thread: > # Py 3.3 ascii and non ascii chars >>>> timeit.repeat("a = 'hundred'; 'x' in a") > [0.11426985953005442, 0.10040049292649655, 0.09920834808588097] >>>> timeit.repeat("a = 'maçãé€ẞ'; 'é' in a") > [0.2345595188256766, 0.21637172864154763, 0.2179096624382737] Python 3.3 is a language. Languages do not have timings. CPython 3.3.0 is an implementation compiled and run under a particular OS and hardware. With respect to Unicode timings, especially for find/replace, it is obsolete. On my Win7 machine with fresh debug builds from the current repository, I see these times. Python 3.3.1+ (default, May 7 2013, 14:03:12) [MSC v.1600 32 bit (Int >>> from timeit import repeat >>> repeat("a = 'hundred'; 'x' in a") [0.19007337649622968, 0.190116721780754, 0.1900149679567562] >>> repeat("a = 'maçaé??'; 'é' in a") [0.20568874581187716, 0.20568782357178053, 0.20577051776710914] Python 3.4.0a0 (default:32067784f198, May 7 2013, 13:59:10) [MSC v.1600 >>> from timeit import repeat >>> repeat("a = 'hundred'; 'x' in a") [0.1708080882915779, 0.17062978853956826, 0.1706740560642051] >>> repeat("a = 'maçaé??'; 'é' in a") [0.17612111348809734, 0.17562925210324565, 0.17549245315558437] Note 1: debug builds are slower than install builds, especially for microbenchmarks with trivial statements. My installed 3.3.1 on a different machine has timings of about .1 for the ascii test. It is slower for the non-ascii test because the latest improvements were made after 3.3.1 was released. Note 2: 3.4 has additional improvements that speed up everything, so that the 3.4 non-ascii time is faster that even the 3.3 ascii time. Terry