From 6abcb32f7df63c64b88a4fef57d38e219d2b6b42 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 24 Jul 2025 22:08:52 +0200 Subject: 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. --- apt-pkg/deb/deblistparser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/deb/deblistparser.h') 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 forceEssential; std::vector forceImportant; std::string MD5Buffer; std::string myArch; + std::string essential; - protected: pkgTagFile Tags; pkgTagSection Section; map_filesize_t iOffset; -- cgit v1.2.3-70-g09d2