[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#643787: apt-cache policy in non-default locale very slow



On Sun, Oct 02, 2011 at 10:07:27PM +0300, Peter Eisentraut wrote:
> 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.
It needs the cache. When the cache is built, package translations
must be checked. Other programs might need it later, and hacking it
in for memory-only caches seems to complicate the thing uselessly.

> 2. It only updates the cache when run as root.  Perhaps it should have a
> per-user cache.
Well, users are not support to have different caches, as the only
modifications done normally need root.

> 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.
If we did something like this, we should do it for C.UTF-8, not for
the C locale. Package descriptions are UTF-8, file names are UTF-8,
everything is UTF-8; so special-casing some arcane locale that is
not really useable on a modern system does not really seem useful.
-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Attachment: pgpBkYduWiAam.pgp
Description: PGP signature


Reply to: