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?
Attached is a basic test set and its output.
I tested apt/trixie (3.0.3) and apt/forky (3.2.0), both against trixie's package data.
Both showed the same slowdown.
PS: I acknowledge the patterns in my tests indicate I'm doing weird/dumb things.
But I think there are probably legitimate reasons to have 10 globs?
Or... thinking about it more, I guess most use cases are either
"Package: *" (testing/unstable hybrids) or
"Package: foo" (apt-listbugs pinning a specific known-buggy package).
And neither of those are globs... OK, yes,
pinning "Package: *" takes ~0.5s and
pinning "Package: * * *" takes ~2s and
pinning 62 specific packages (src:libreoffice, src:linux, clang-17, clang-18, &c) takes 0.4s.
pinning 13000 specific packages (each foo-dev by name) takes 0.4s.
So this slowdown hits ONLY when you have globs rather than exact package names.
Which is a MUCH less common thing to do.