From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LW3Bn-0007B6-SW for garchives@archives.gentoo.org; Sun, 08 Feb 2009 06:30:48 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F017CE0436; Sun, 8 Feb 2009 06:30:45 +0000 (UTC) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by pigeon.gentoo.org (Postfix) with ESMTP id A9D83E0436 for ; Sun, 8 Feb 2009 06:30:45 +0000 (UTC) Received: by wf-out-1314.google.com with SMTP id 29so1494334wff.10 for ; Sat, 07 Feb 2009 22:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=/0YR+6PnE9mCwvFw88k4wWkjmgZOqZqhRiQhBIiLCDw=; b=Zerte2KZ3y/dDOBqwsetb806rd6BfXlo/0sxcAdhilkBtoYx1DTvraBklAbjZnwErU RIOtFCLJOzx9lFbUY/FulWe8n0UchfKICbNdTToLSOB2HM8YdKp+xflPp8XhkvPdQUho 8bnON/mnoCsff//29UqVK+1yM/2Rny2YYZDjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=VTF/dlsqrvxUc6RZB9xT/hrc+03NBI3HgEXFkK6lgWeLltqBfvR9W4ZMBcLntBuaOj t/QkKTORcQS9Pi/JGmJB4lOGbRY9GDuzaJevuERrjX/NQGcz5MHXb7PI36sQiRaCF28V FkwQqSYmFR0J4WEArIthyPE4cyYZ0O18rnLtg= Received: by 10.142.174.8 with SMTP id w8mr2093496wfe.61.1234074645281; Sat, 07 Feb 2009 22:30:45 -0800 (PST) Received: from smtp.gmail.com (c-98-210-196-21.hsd1.ca.comcast.net [98.210.196.21]) by mx.google.com with ESMTPS id 28sm5676151wfd.5.2009.02.07.22.30.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 07 Feb 2009 22:30:44 -0800 (PST) Received: by smtp.gmail.com (sSMTP sendmail emulation); Sat, 07 Feb 2009 22:30:15 -0800 Date: Sat, 7 Feb 2009 22:30:15 -0800 From: Brian Harring To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] equery: deprecate --category filtering in belongs Message-ID: <20090208063015.GB4076@hrair> References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OBd5C1Lgu00Gd/Tn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) X-Archives-Salt: 6d28f40a-6289-4754-a194-2e03660df29c X-Archives-Hash: 50d8b96baf9e9e9dd6b816201ebf8d93 --OBd5C1Lgu00Gd/Tn Content-Type: multipart/mixed; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable patch attached against 0.2.4.2-r1; rough stats follow; full cold cache [ Searching for file(s) /usr/bin/equery in *... ] app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery) real 0m10.320s user 0m0.733s sys 0m0.162s [ Searching for file(s) /usr/bin/equery in app-portage... ] app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery) real 0m8.512s user 0m0.315s sys 0m0.124s That particular cold cache is a *full* cold cache; not the best test=20 imo since most users have at least some chunks of portage=20 configuration/python cached. Cold cache, with equery --help primer to warm the cache; CONTENTS=20 (what belongs operates on) is still out of the cache however making=20 this a bit more likely use scenario. [ Searching for file(s) /usr/bin/equery in *... ] app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery) real 0m2.335s user 0m0.670s sys 0m0.050s [ Searching for file(s) /usr/bin/equery in app-portage... ] app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery) real 0m0.391s user 0m0.248s sys 0m0.046s Pretty heavy difference, no? hotcache: [ Searching for file(s) /usr/bin/equery in *... ] app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery) real 0m0.710s user 0m0.661s sys 0m0.047s [ Searching for file(s) /usr/bin/equery in app-portage... ] app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery) real 0m0.291s user 0m0.237s sys 0m0.053s Mind you this isn't multiple runs, so the numbers are rough=20 approximations- that said they're fairly representative. Strongly suggest y'all keep category support (although I'll keep on=20 using pquery instead ;). Cheers, ~harring --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="equery-enable-categories.patch" Content-Transfer-Encoding: quoted-printable --- /usr/bin/equery 2009-02-07 13:16:51.000000000 -0800 +++ /home/ferringb/equery 2009-02-07 14:15:52.000000000 -0800 @@ -345,7 +345,7 @@ need_help =3D 1 break elif x in ["-c", "--category"]: - opts["category"] =3D args[i+1] + opts["category"] =3D args[i+1].rstrip("/") skip =3D 1 elif x in ["-e", "--earlyout"]: opts["earlyOut"] =3D 1 @@ -383,16 +383,14 @@ die(2, "The query '" + pp.regexpquery(q) + "' does not appear to be a v= alid regular expression") =20 # Pick out only selected categories - cat =3D opts["category"] - filter_fn =3D None - if cat !=3D "*": - filter_fn =3D lambda x: x.find(cat+"/")=3D=3D0 =20 + cat =3D opts["category"] if not Config["piping"] and Config["verbosityLevel"] >=3D 3: print_info(3, "[ Searching for file(s) " + pp.regexpquery(",".join(quer= y)) + " in " + pp.cpv(cat) + "... ]") =09 matches =3D portage.db["/"]["vartree"].dbapi.cpv_all() - #matches =3D gentoolkit.find_all_installed_packages(filter_fn) + if cat !=3D "*": + matches =3D (x for x in matches if x.startswith(cat)) =20 found =3D 0 =20 --2B/JsCI69OhZNC5r-- --OBd5C1Lgu00Gd/Tn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkmOe/cACgkQsiLx3HvNzgd2LwCfWSG3VdNi7B4jLZRXgtiyhOxd b2UAn1jJh7Ea3oFthw/xSQRMWxZM8VCU =8A1I -----END PGP SIGNATURE----- --OBd5C1Lgu00Gd/Tn--