From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1FJmlX-000418-FP for garchives@archives.gentoo.org; Thu, 16 Mar 2006 07:19:23 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5.20060308/8.13.5) with SMTP id k2G7IiOt023696; Thu, 16 Mar 2006 07:18:44 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.5.20060308/8.13.5) with ESMTP id k2G7Iibe025419 for ; Thu, 16 Mar 2006 07:18:44 GMT Received: from c-67-171-150-177.hsd1.or.comcast.net ([67.171.150.177] helo=[192.168.1.106]) by smtp.gentoo.org with esmtpa (Exim 4.54) id 1FJmkt-0007Vk-Sg for gentoo-portage-dev@lists.gentoo.org; Thu, 16 Mar 2006 07:18:44 +0000 Message-ID: <4419103C.4070706@gentoo.org> Date: Wed, 15 Mar 2006 23:14:04 -0800 From: Donnie Berkholz User-Agent: Mail/News 1.5 (X11/20060208) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH] Manifest2 reloaded References: <20060304035031.4a7aa82b@delenn.genone.homeip.net> <4418A6D5.1010903@gentoo.org> <4418FD54.2020009@gentoo.org> <20060316071542.GA21152@nightcrawler.had1.or.comcast.net> In-Reply-To: <20060316071542.GA21152@nightcrawler.had1.or.comcast.net> X-Enigmail-Version: 0.94.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5479549153A2E2AF1A85709E" X-Archives-Salt: 54ed2d0d-6f56-4ebb-9afd-eb43d755ed13 X-Archives-Hash: d5da0bc2d4c5861a3181315a24abfae3 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5479549153A2E2AF1A85709E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Brian Harring wrote: > python -m timeit -s 's=3D"asdf"*400;s+=3D"fdsa.ebuild"' 's.endswith(".e= build")' > 1000000 loops, best of 3: 0.88 usec per loop > python -m timeit -s 's=3D"asdf"*400;s+=3D"fdsa.ebuild"' 's[-7:] =3D=3D = ".ebuild"' > 1000000 loops, best of 3: 0.564 usec per loop > Use endswith > oddly, worth noting that startswith differs in this behaviour... > python -m timeit -s 's=3D"asdf"*400;s+=3D"fdsa.ebuild"' 's[:7] =3D=3D "= =2Eebuild"' > 1000000 loops, best of 3: 0.592 usec per loop > python -m timeit -s 's=3D"asdf"*400;s+=3D"fdsa.ebuild"' 's.startswith("= =2Eebuild")' > 1000000 loops, best of 3: 0.842 usec per loop Um, those both read the same way to me. You just switched the ordering around, so the (starts|ends)with is on the bottom instead of the top, but both times (starts|ends)with is longer. Thanks, Donnie --------------enig5479549153A2E2AF1A85709E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (GNU/Linux) iD8DBQFEGRA8XVaO67S1rtsRAkbhAJ4gpVIFRaek+3K8jhZl8IVDmd91bwCggAYn DcrWM4fURJGy0LCTeGl6qcY= =MJoX -----END PGP SIGNATURE----- --------------enig5479549153A2E2AF1A85709E-- -- gentoo-portage-dev@gentoo.org mailing list