summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.h
Commit message (Collapse)AuthorAgeFilesLines
* drop stored StringItems in favor of in-memory mappingsDavid Kalnischkies2014-09-271-28/+2
| | | | | | | | | | | | | | | Strings like Section names or architectures are needed vary often. Instead of writing them each time we need them, we deploy sharing for these special strings. Until now, this was done with a linked list of strings in which we would search, which was stored in the cache. It turns out we can do this just as well in memory as well with a bunch of std::map's. In memory means here that it isn't available anymore if we have a partly invalid cache, but that isn't much of a problem in practice as the status file is compared to the other files we parse very small and includes mostly duplicates, so the space we would gain by storing is more or less equal to the size of the stored linked list…
* deprecate Pkg->Name in favor of Grp->NameDavid Kalnischkies2014-09-271-2/+5
| | | | | | | They both store the same information, so this field just takes up space in the Package struct for no good reason. We mark it "just" as deprecated instead of instantly removing it though as it isn't misleading like Section was and is potentially used in the wild more often.
* remove the Section member from package structDavid Kalnischkies2014-06-181-5/+0
| | | | | | | | | | | | | | | | | | A version belongs to a section and has hence a section member of its own. A package on the other hand can have multiple versions from different sections. This was "solved" by using the section which was parsed first as order of sources.list defines, but that is obviously a horribly unpredictable thing. We therefore directly remove this struct member to free some space and mark the access method as deprecated, which is told to return the section of the 'newest' known version, which is at least predictable, but possible not what it returned before – but nobody knows. Users are way better of with the Section() as returned by the version they are dealing with. It is likely the same for all versions of a package, but in the few cases it isn't, it is important (like packages moving from main/* to contrib/* or into oldlibs …).
* cleanup datatypes mix used in binary cacheDavid Kalnischkies2014-06-181-89/+101
| | | | | | | | We had a wild mixture of (unsigned) int, long and long long here without much sense, so this commit adds a few typedefs to get some sense in the typesystem and ensures that a ID isn't sometimes computed as int, stored as long and compared with a long long… as this could potentially bite us later on as the size of the archive only increases over time.
* increase hashtable size for packages/groups by factor 5David Kalnischkies2014-06-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It also makes the size configureable, so it can be adapted in the future without the need for an abi break - and even by users… The increase was long overdue as it gives a >10% decrease in runtime of e.g. 'apt-get check -s'. Some (useless) benchmark with 69933 groups and 187796 packages without a pre-built cache: time apt-get check -so APT::Cache-HashTableSize=1 → 20m time apt-get check -so APT::Cache-HashTableSize=1000 → 6,41s time apt-get check -so APT::Cache-HashTableSize=2000 → 5,64s (old) time apt-get check -so APT::Cache-HashTableSize=3000 → 5,30s time apt-get check -so APT::Cache-HashTableSize=5000 → 5,08s time apt-get check -so APT::Cache-HashTableSize=6000 → 5,05s time apt-get check -so APT::Cache-HashTableSize=7000 → 5,02s time apt-get check -so APT::Cache-HashTableSize=8000 → 5,00s time apt-get check -so APT::Cache-HashTableSize=9000 → 4,98s time apt-get check -so APT::Cache-HashTableSize=10000 → 4,96s (new) time apt-get check -so APT::Cache-HashTableSize=15000 → 4,90s time apt-get check -so APT::Cache-HashTableSize=20000 → 4,86s time apt-get check -so APT::Cache-HashTableSize=30000 → 4,77s time apt-get check -so APT::Cache-HashTableSize=40000 → 4,74s time apt-get check -so APT::Cache-HashTableSize=50000 → 4,73s time apt-get check -so APT::Cache-HashTableSize=60000 → 4,71s The gap increases further for operations which have more package lookups. Factor 5 was chosen as higher values do not provide any really significant timing advantage anymore compared to the memory increase in my testing and there is always the possibility to increase it now if that changes. (also most users will not have 3 releases and 4 architectures in the cache, so theirs will be much smaller and faster).
* Merge remote-tracking branch 'mvo/feature/hash-stats' into debian/experimentalMichael Vogt2014-06-181-3/+3
|\ | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/deb/debmetaindex.h apt-pkg/pkgcache.cc test/integration/test-apt-ftparchive-src-cachedb
| * [API-Break] rename pkgCache::Package::NextPackage to pkgCache::Package::NextMichael Vogt2014-06-181-1/+1
| | | | | | | | | | This is a internal struct not a external interface so the actual breakage should be small.
| * increase Pkg/Grp hash table size from 2k to 64kMichael Vogt2014-05-291-2/+2
| |
* | invalid cache if architecture set doesn't matchDavid Kalnischkies2014-05-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The cache heavily depends on the architecture(s) it is build for, especially if you move from single- to multiarch. Adding a new architecture to dpkg therefore has to be detected and must invalidate the cache so that we don't operate on incorrect data. The incorrect data will prevent us from doing otherwise sensible actions (it doesn't allow bad things to happen) and the recovery is simple and automatic in most cases, so this hides pretty well and is also not as serious as it might sound at first. Closes: 745036
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-05-071-33/+35
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/cachefilter.h apt-pkg/contrib/fileutl.cc apt-pkg/contrib/netrc.h apt-pkg/deb/debsrcrecords.cc apt-pkg/init.h apt-pkg/pkgcache.cc debian/apt.install.in debian/changelog
| * follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-6/+8
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
| * warning: type qualifiers ignored on function return type [-Wignored-qualifiers]David Kalnischkies2014-03-131-2/+2
| | | | | | | | | | Reported-By: gcc -Wignored-qualifiers Git-Dch: Ignore
| * warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-21/+21
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
| * make doxygen more quiet, fix issues and disable latexDavid Kalnischkies2014-03-131-4/+4
| | | | | | | | Git-Dch: Ignore
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-02-271-1/+1
|\| | | | | | | | | | | | | | | Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
| * Fix typos in documentation (codespell)Michael Vogt2014-02-221-1/+1
| |
* | * [ABI BREAK] apt-pkg/pkgcache.h:Michael Vogt2013-01-081-1/+1
|/ | | - adjust pkgCache::State::VerPriority enum, to match reality
* revert 2184.1.2: do not pollute namespace in headersDavid Kalnischkies2011-12-131-1/+4
| | | | | The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users
* * apt-pkg/depcache.cc:David Kalnischkies2011-11-231-1/+1
| | | | | | | | - prefer native providers over foreigns even if the chain is foreign The code preferred real over virtual packages and based on priorities. This is changed in so far that a real package from any arch is preferred over any virtual provider and if priorities doesn't help in choosing the best provider we choose it based on architectures
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-9/+7
|
* apt-pkg/pkgcache.h: Add pkgCache::Header::CacheFileSize, storing the cache sizeJulian Andres Klode2011-07-201-0/+3
|
* * apt-pkg/pkgcache.h:David Kalnischkies2011-06-291-1/+3
| | | | | - readd All{Foreign,Allowed} as suggested by Julian to remain strictly API compatible
* * apt-pkg/pkgcache.h:David Kalnischkies2011-05-171-7/+10
| | | | - clean up mess with the "all" handling in MultiArch to fix LP: #733741 cleanly for everyone now
* * apt-pkg/pkgcache.cc:David Kalnischkies2011-04-061-0/+6
| | | | - use the native Architecture stored in the cache header instead of loading it from configuration as suggested by Julian Andres Klode
* * apt-pkg/cacheiterator.h:David Kalnischkies2011-03-251-2/+2
| | | | | | - return "all" instead of native architecture without breaking the abi (too much) by extending enum instead of using bitflags (LP: #733741) With the next abi break that enum should be a char bitflag instead
* Remove the "pseudopackage" handling of Architecture: all packages forDavid Kalnischkies2011-03-081-2/+2
| | | | | | | | | Multi-Arch; instead, Arch: all packages only satisfy dependencies for the native arch, except where the Arch: all package is declared Multi-Arch: foreign. (Closes: #613584) This has the sideeffect that arch:all packages internally show up as coming from the native arch - so packages with the architecture "all" doesn't exist any longer in the pkgcache
* * apt-pkg/policy.cc:David Kalnischkies2010-09-141-1/+1
| | | | | | - support 100-pinning in Release file with ButAutomaticUpgrades as requested by the backports crew (Closes: #596097) * apt-pkg/deb/deblistparser.cc: - overrule NotAutomatic in case of ButAutomaticUpgrades
* * apt-pkg/pkgcachegen.{cc,h}:David Kalnischkies2010-07-081-1/+1
| | | | - make the used MMap moveable (and therefore dynamic resizeable) by applying (some) mad pointer magic (Closes: #195018)
* * apt-pkg/pkgcache.h:David Kalnischkies2010-06-031-2/+2
| | | | | - switch {,Install-}Size to unsigned long long * apt-pkg/depcache.cc: - deal with long long, not with int to remove 2GB Limit (LP: #250909)
* * apt-pkg/pkgcache.h:David Kalnischkies2010-05-041-3/+7
| | | | - enhance the Groups ABI by providing a ID as the other structs does - check also the size of the Group struct then checking for the others
* * doc/cache.sgml:David Kalnischkies2010-05-041-84/+385
| | | | - drop the file in favor of inplace documentation with doxygen
* Readd the FindPkg() method implementation used in the singleArch days toDavid Kalnischkies2010-03-181-1/+7
| | | | | use it as a fallback if multiarch is not enabled. The effect is barly noticeable but SingleArch is the realworld scenario.
* Add yet another pseudo package which isn't as pseudo as the others:David Kalnischkies2010-02-121-1/+1
| | | | | | | | | | Arch all packages are now represented by arch depending packages which all depend on a package with the same name and the special arch "all". This packages has NO dependencies, but beside this the same information. It is the only package which has a size, the arch depending ones all have a zero size. While the arch depending pseudo packages are used for dependency resolution the arch "all" package is used for downloading and ordering of the package.
* Drop the Arch information from the Version structure as we can getDavid Kalnischkies2010-02-071-1/+0
| | | | the information from the parent package now
* Split ListParser::NewDepends into two methods to use these new methodDavid Kalnischkies2009-12-271-2/+10
| | | | | | | | | for creating the dependencies needed for our groups: For now for all groups only one package can be installed at the same time which conflicts with each other packages in the group. The exceptions are architecture all package. Also, the Multi-Arch field is now parsed, but not used for now.
* Implement the first step toward Multi-Arch by setting up a GroupDavid Kalnischkies2009-12-191-5/+25
| | | | | | | | | | | | infrastructor for packages. APT is now aware of the fact that a package A in architecture X can't satisfy a dependency on package A in architecture Y - to handle these packages are now identified by name and architecture, so different architectures of the same package are handled internally as completly different packages. This is great for pinning, dependency checking and in many other situations, but sometimes we need to know which archs are available for a given package: Here Groups come to our rescue!
* Refactor the cache iterators by using a common base classDavid Kalnischkies2009-12-091-8/+1
| | | | | This should not change the public interface, but it removes the friend connection between the iterators and pkgcache as it is unused.
* use long instead of short for {Ver,Desc}File size in pkgcache.hDavid Kalnischkies2009-11-251-2/+2
| | | | patch from Víctor Manuel Jáquez Leal, thanks! (Closes: #538917)
* add the various foldmarkers in apt-pkg & cmdline (no code change)David Kalnischkies2009-06-301-24/+24
|
* [ABI break] Allow pinning by codename (closes: #97564)Michael Vogt2009-06-291-0/+1
|\
| * [apt-pkg] allow also codenames for specifying a releaseDavid Kalnischkies2009-05-071-0/+1
| | | | | | | | | | * MatchType::Release checks first for archive than for codename equality * new n= option in apt_preference to be able to pin based on a codeName
* | Introduce support for the Enhances field. (Closes: #137583) jak@debian.org2009-06-151-1/+1
|/
* * apt-pkg/contrib/strutl.cc:Michael Vogt2009-04-091-4/+4
| | | | | | | | | | | | | | | | | | | - fix TimeToStr i18n (LP: #289807) * [ABI break] merge support for http redirects, thanks to Jeff Licquia and Anthony Towns * [ABI break] use int for the package IDs (thanks to Steve Cotton) * apt-pkg/pkgcache.cc: - do not run "dpkg --configure pkg" if pkg is in trigger-awaited state (LP: #322955) * methods/https.cc: - add Acquire::https::AllowRedirect support * Clarify the --help for 'purge' (LP: #243948) * cmdline/apt-get.cc - fix "apt-get source pkg" if there is a binary package and a source package of the same name but from different packages (LP: #330103) * cmdline/acqprogress.cc: - Call pkgAcquireStatus::Pulse even if quiet, so that we still get dlstatus messages on the status-fd (LP: #290234).
* * dpkg-triggers: Deal properly with new package states.Michael Vogt2007-09-061-1/+2
|
* * merged the apt-breaks-iwj branchMichael Vogt2006-12-141-1/+5
|\ | | | | | | * pulled in the other remaining ubuntu changes
| * initial Breaks implementationIan Jackson2006-08-251-1/+5
| |
| * * merged ddtp supportMichael Vogt2006-08-111-2/+42
| |\
* | \ * merged the no-pragma branchMichael Vogt2006-12-141-3/+0
|\ \ \
| * | | * removed the pragma messMichael Vogt2006-10-021-3/+0
| |/ /
* | / * merged with apt--mvoMichael Vogt2005-11-301-3/+3
|\| | | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patches applied: * apt@packages.debian.org/apt--sources-list-d--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-30 * apt@packages.debian.org/apt--sources-list-d--0--patch-1 Patch from apt-rpm via Michael Vogt to implement /etc/apt/sources.list.d * bubulle@debian.org--2005/apt--main--0--patch-130 Galician translation completed * bubulle@debian.org--2005/apt--main--0--patch-131 Simplified Chinese translation update * bubulle@debian.org--2005/apt--main--0--patch-132 Completed Simplified Chinese translation * bubulle@debian.org--2005/apt--main--0--patch-133 Merge with Michael AND update PO files * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-90 * merged the sources.list.d patch * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-91 * merged with bubulle * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-92 * changelog update * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-93 * sources.list.d documented * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-94 * pkgDirStream has (slightly) better extract support now * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-95 * merge fix for #339533 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-96 * merged with bubulle * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-97 * some more debug output * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-98 * ABI change: merged more flexible pkgAcquireFile code * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-99 * merged http download limit for apt (#146877) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-100 * applied parts of the string speedup patch from debian #319377 (ABI change) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-101 * fix for #340448 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-102 * finalized this release * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-103 * changelog updates * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-104 * build-depend on libdb4.3 now, fix for kFreeBSD (#317718) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-105 * fix mailaddress * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-106 * fix a string (thanks to bubulle) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-107 * merged with bubulle