[Aptitude-devel] Bug#142656: aptitude: commandline search should be faster
Manuel A. Fernandez Montecelo
manuel.montezelo at gmail.com
Tue Apr 26 17:33:56 UTC 2016
Control: tags -1 - confirmed
Control: close -1
2004-02-03 20:12 Daniel Burrows:
> Just a note: I investigated this bug a bit recently, and determined
>that almost all the time is spent in startup code -- the search itself,
>while not as fast as it could be, takes up over half the runtime.
>(unscientifically determined by modifying the program to halt
>immediately after initializing itself)
> I would suspect at this point, with almost no evidence ;-), that the
>problem is at least partly the huge text database of states that aptitude
>loads on startup.
I've been doing some optimisation of the initialisation in the 0.7
series which should have helped with this.
On my system (with unstable and experimental, dbgsym packages, and
multi-arch enabled -- more than 90K packages in total), "aptitude search
aptitude" takes just under one second, "aptitude search
'~ddoes-not-exist'" just under two seconds. "aptitude search '~d.'"
takes 3.6 seconds, and the output is 92+k lines printed.
Comparing aptitude and apt for search speed is apples and oranges,
aptitude does much more than apt:
- can search with patterns,
- match by debtags or user-tags which apt doesn't even support (for
which it has to read different files --and not very small--), just in
case that the user wants to use these patterns to match against
- access additional info like installed state + planned action +
automatically installed (which shows by default)
- the columns can contain (and by default, they do contain) much more
information in addition to apt-cache's "name and description only"
- then sort and columnize the result
So I don't think that aptitude's search is specially slow or
inefficient, or that its current speed/slowness is a usability problem,
or that spending significant time  to improve the efficiency is a
good use of developer efforts at this point.
So I am closing the report now, after more than 14 years open (and more
than 12 of inactivity) :)
 after what I spent already to optimise the 0.7 series, which was
about a week, I estimate that even very minor gains (<5%) can take
the best part of a day at the very least
Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
More information about the Aptitude-devel