Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!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.037 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'handler': 0.05; 'cache': 0.07; 'compiler': 0.07; 'counting': 0.09; 'executed': 0.09; 'throws': 0.09; "wouldn't": 0.14; 'filename:fname piece:signature': 0.16; 'fits': 0.16; 'proceeds': 0.16; 'readable': 0.16; 'received:10.13': 0.16; 'targeting': 0.16; 'wrote:': 0.18; 'possible,': 0.19; 'slightly': 0.19; 'header:User- Agent:1': 0.23; 'fairly': 0.24; 'handling': 0.26; 'mention': 0.26; 'header:In-Reply-To:1': 0.27; 'instruction': 0.29; 'needed.': 0.30; 'especially': 0.30; 'code': 0.31; 'that.': 0.31; 'gcc': 0.31; 'up.': 0.33; 'ago': 0.33; 'guess': 0.33; 'could': 0.34; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'c++': 0.36; 'shorter': 0.36; 'yield': 0.36; 'possible': 0.36; 'example,': 0.37; 'received:10': 0.37; 'architecture': 0.38; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'anything': 0.39; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'called': 0.40; 'days': 0.60; 'results.': 0.60; 'exchange': 0.63; 'more': 0.64; 'different': 0.65; 'great': 0.65; 'compilers,': 0.84; 'gone.': 0.84; 'hand.': 0.84; 'measure.': 0.84; 'timings': 0.84; 'you\xe2\x80\x99re': 0.91; 'insane': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wielicki.name; s=k001.sol; t=1431865540; bh=3nPwWjIpYGq8Cl9NSc+4dL2O+zbFBkL/7ftofy/RMeg=; h=Date:From:To:Subject:References:In-Reply-To; b=va3P5nx8xqnKku0QMQUF741vb9VPtgQlF4gh/ZZt7VJyOgV7NENPEi37cgqg57cno QGiVuF0CdNGL7i9zQm5Jni0Hbs8qOZudM02ylqtKgZ8w1+5QW7aNrLMQuLvcj2pXzC 5GQYr05RYR7Smwk2Slb5WeFNs+3iquWhzrNpLdjFChBOJW0Q8bfO2LegVnVs9CnT1e 9uDZpnSokaL6oPGM0QXWEUt1mYnz9p9Km66BSaPi8xHhaJ0JOgNbm6N/2NzplNHVsK 0wWcHlV0eMrsv+H1rseb7ZpkehJ80SaDicsflK61Bf1X56Uh1bP4ZbXAI6KJClOJFl nIY6EBDg2K1sw== Date: Sun, 17 May 2015 14:25:29 +0200 From: Jonas Wielicki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Building CPython References: <7JN4x.37133$Q41.15375@fx25.am4> <6w35x.645690$I97.19867@fx31.am4> <874mnfunpn.fsf@elektro.pacujo.net> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9xl4BPAaelMskGWGcv8SSTlILJ8L2p4fb" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 66 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431866130 news.xs4all.nl 2837 [2001:888:2000:d::a6]:48999 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90768 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9xl4BPAaelMskGWGcv8SSTlILJ8L2p4fb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 16.05.2015 02:55, Gregory Ewing wrote: > BartC wrote: >> For example, there is a /specific/ byte-code called BINARY_ADD, which >> then proceeds to call a /generic/ binary-op handler! This throws away >> the advantage of knowing at byte-code generation time exactly which >> operation is needed. >=20 > While inlining the binary-op handling might give you a > slightly shorter code path, it wouldn't necessarily speed > anything up. It's possible, for example, that the shared > binary-op handler fits in the instruction cache, but the > various inlined copies of it don't, leading to a slowdown. >=20 > The only way to be sure about things like that is to try > them and measure. The days when you could predict the speed > of a program just by counting the number of instructions > executed are long gone. That, and also, the days where you could guess the number of instructions executed from looking at the code are also gone. Compilers, and especially C or C++ compilers, are huge beasts with an insane number of different optimizations which yield pretty impressive results. Not to mention that they may know the architecture you=E2=80=99re targeting and = can optimize each build for a different architecture; which is not really possible if you do optimizations which e.g. rely on cache characteristics or instruction timings or interactions by hand. I changed my habits to just trust my compiler a few years ago and have more readable code in exchange for that. The compiler does a fairly great job, although gcc still outruns clang for *my* usecases. YMMV. regards, jwi --9xl4BPAaelMskGWGcv8SSTlILJ8L2p4fb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJVWIjBAAoJEMBiAyWXYliKd/cP/jkuvfNuNF/5WCjymR89t0Nt /aoxcQzze/K7IhJAGS4T98kVonHjshvXrtfj/f6sCV++eOefw3LVCnylwrjjPoZm 1ZzpwA1CD23oz4lkGo4aJODDkO/9WoK9hqcXvq/AF/lA4Vn3R261tkhMzY3T98Vl 1jDheJu44rqe1Lt0XSB6IYvfmePY22LzqzLXGeTcDfNenXLYxe+U/IP6OusfzuKS pFSd6TRa+UgMfpUI87k1VS3Ls7MwVlepTRi+OA45bJ/juhXVe+gXAG0pSPriAFPz NlKvhw2bfGW2FgUZ1rcdcOdtcDtBPE/0IMnc3TXjv2i69f0/UK9zrw3Y64i26Z67 o4H8DRkQd8KxCSNEc4oXSdlWJpDM3yBzYXvbnhbcULvoLd+A8hpp3s+d7nW4aJkK b0OWAAm/tP25Fc+knvhA/m9LeokOQ8sWVT2Bj0jd/TuZ66lqPOnHBylfjKZ76LaR TJbw8SOvfSOSA6oa+QXy8bs39/4B8DKrkWWHBjnQ0qOO3TtFeKyJlLRCphPMUC2g FfiBEPHNVSbQ9h8XsUSoJjDv0hVDgwCV8lPlKnJHnyIIFhIcHf6gA0SqSEHDlBvW 8eqgd/J/SKs4wpIIEe2l88l5gLv3NuYq3Pm9fC/CpfX0Z3RRmSm1qjDFU/h+ht1J uCIpS78dDfTCp9FEGA1M =WuvZ -----END PGP SIGNATURE----- --9xl4BPAaelMskGWGcv8SSTlILJ8L2p4fb--