From e9185eca390435b4060ef26c7c69d39f994da7a7 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 27 Dec 2015 01:33:38 +0100 Subject: pkgcachegen: Use std::unordered_map instead of std::map std::unordered_map is faster than std::map in our use case, reducing cache generation time by about 10% in my benchmark. --- apt-pkg/pkgcachegen.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-pkg/pkgcachegen.h') diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 328d296bf..9001e334f 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -26,7 +26,7 @@ #include #include -#include +#include class FileFd; class pkgSourceList; @@ -41,10 +41,10 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String, const unsigned long &Len); APT_HIDDEN map_pointer_t AllocateInMap(const unsigned long &size); - std::map strMixed; - std::map strSections; - std::map strPkgNames; - std::map strVersions; + std::unordered_map strMixed; + std::unordered_map strSections; + std::unordered_map strPkgNames; + std::unordered_map strVersions; friend class pkgCacheListParser; typedef pkgCacheListParser ListParser; -- cgit v1.2.3