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

Re: [PATCH 0/3] speed up apt-get startup by ~19%



On Sun, Jan 26, 2014 at 12:48:39PM +0100, David Kalnischkies wrote:
> > These patches reduce the startup time of apt-get by ~19% on my system. I
> > measured by first doing "apt-get source sl", then running this command:
> […]
> 
> Do you have any special reason to pick this command?

You mean, for picking "apt-get source sl"? Yes, I use "apt-get source"
relatively often and I was afraid of messing around with apt-get code while
running it as root – I was doing this on my main box, don't want do
accidentially wreck it.


> I forgot to remove the binary caches at first, which caused me to see no
> meaningful difference, but maybe my machine is just too quick¹.

> Removing both caches shows the difference through (for me ~10%, but in a
> 5 second run, so this is very close to your results).
> I checked with "apt-get check -s" as this just generates the caches (in
> memory if run as user) and does the dependency walk which is run by the
> other apt-get commands as basic setup.
> 
> (¹ that I would ever be able to say that…)

Oh, interesting, after "apt-get check" as root, "apt-get source <name>"
becomes much faster. Looks like that cache you're talking about was stale and
because I ran the apt-get commands as a user, the cache wasn't updated? Is that
case supposed to be possible?


> > What do you think? Rewriting the whole source like this would probably make it
> > much uglier, but IMO optimizing a few hot code paths this way should be fine.
> 
> Did you tried it with some sort of tool or just by "guessing"?
> We had a while back similar improvements with our own tolower
> reimplementation, so as long as speedups are observable and are
> not to crude I have no problem with adding them.

Yes, I used callgrind and kcachegrind to profile it.


> (Will follow up on the patches itself in a second)

Thanks!

Attachment: signature.asc
Description: Digital signature


Reply to: