summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/deblistparser.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2025-07-24 22:08:52 +0200
committerJulian Andres Klode <jak@debian.org>2025-08-26 11:49:18 +0000
commit6abcb32f7df63c64b88a4fef57d38e219d2b6b42 (patch)
tree2dafe4ab2d7965cf38effd7876fc9e5a8eae4803 /apt-pkg/deb/deblistparser.h
parent27a6bb49ea806e808bf6ebd849542bd32cf256c6 (diff)
debListParser: Cache `essential` and `myArch` more
Lookup these variables in the constructor once, rather than once per package. This requires a bit of care as debListParser::UsePackage() defaults to "all" for essential when unset, hence we simply change its == "all" comparisons to == "all" || .empty().# This removes any per-paragraph configuration lookups from the file parser. Also parse myArch from ParseProvides down to ParseDepends() as that call ended up causing it to query APT::Architecture *again* since the function we call is static. Together, the removed config lookups safe about 2.3% of cache generation runtime.
Diffstat (limited to 'apt-pkg/deb/deblistparser.h')
-rw-r--r--apt-pkg/deb/deblistparser.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index ff1bfa06c..2a9108775 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -36,13 +36,13 @@ class APT_HIDDEN debListParser : public pkgCacheListParser
unsigned char Val;
};
- private:
+ protected:
std::vector<std::string> forceEssential;
std::vector<std::string> forceImportant;
std::string MD5Buffer;
std::string myArch;
+ std::string essential;
- protected:
pkgTagFile Tags;
pkgTagSection Section;
map_filesize_t iOffset;