From eff0c22e59e65b6b63e854ff41eb091278e05714 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 7 Jan 2016 19:16:23 +0100 Subject: Switch performance critical code to use APT::StringView This improves performance of the cache generation on my ARM platform (4x Cortex A15) by about 10% to 20% from 2.35-2.50 to 2.1 seconds. --- apt-pkg/cacheiterators.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apt-pkg/cacheiterators.h') diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 0647e39f1..75a31a4b3 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -35,6 +35,9 @@ #include #include #include +#ifdef APT_PKG_EXPOSE_STRING_VIEW +#include +#endif #include @@ -114,6 +117,10 @@ class pkgCache::GrpIterator: public Iterator { inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;} inline PkgIterator PackageList() const; PkgIterator FindPkg(std::string Arch = "any") const; +#ifdef APT_PKG_EXPOSE_STRING_VIEW + APT_HIDDEN PkgIterator FindPkg(APT::StringView Arch = APT::StringView("any", 3)) const; + APT_HIDDEN PkgIterator FindPkg(const char *Arch) const; +#endif /** \brief find the package with the "best" architecture The best architecture is either the "native" or the first -- cgit v1.2.3