Bug#643787: apt-cache policy in non-default locale very slow
On tor, 2011-09-29 at 22:33 +0200, Julian Andres Klode wrote:
> On Thu, Sep 29, 2011 at 08:17:23PM +0300, Peter Eisentraut wrote:
> > Package: apt
> > Version: 0.8.15.8
> > Severity: normal
> >
> > If I run apt-cache policy (without arguments), it takes milliseconds.
> > If I run it under a different locale, e.g., LC_ALL=C apt-cache policy,
> > it takes about 4 or 5 seconds. There are some package build tools
> > that indirectly call apt-cache policy with LC_ALL=C, which makes the
> > overall package build very slow.
>
> That's expected, APT needs to rebuild the cache to include/drop
> translation indices.
OK, that explains it. But:
1. apt-cache policy doesn't actually need the package translations.
2. It only updates the cache when run as root. Perhaps it should have a
per-user cache.
3. In any case, it would be good if the LC_ALL=C case could somehow be
optimized for programmatic use. It's used in a number of places.
Reply to: