Bug#1133971: With 10+ apt_preferences(5) globs pinned, "apt show mg" is much slower than "apt-cache show mg"

Julian Andres Klode <[email protected]> Thu, 16 Apr 2026 19:52:07 +0200
Newsgroups gmane.linux.debian.apt.devel
Message-ID <20260416195114.GA645507__31815.8585157775$1776362009$gmane$org@debian.org>
On Thu, Apr 16, 2026 at 03:06:03PM +1000, Trent W. Buck wrote:
> Package: apt
> Version: 3.0.3
> Severity: wishlist
> File: /bin/apt
> 
> I noticed a significant slowdown as I add Package: globs to apt_preferences.
> 1 glob costs 0.5-0.8s
> 10 globs costs costs 2-3s
> 60 globs costs 8-10s
> It does not matter if these globs match 10,000 packages or 0 packages.
> 
> Is this an expected amount of delay, or has something gone wrong?
> 
> 
> I noticed that apt show & apt list still exhibit this slowdown, where
> apt-cache show and dpkg-query --show do not.
> 
> Is the new CLI (/bin/apt) loading apt_preferences(5) when it does not need to?

it needs to; it shows pinning.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en