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/contrib/strutl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apt-pkg/contrib/strutl.h') diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index a8bbc38af..c5c8e2382 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -22,6 +22,9 @@ #include #include #include +#ifdef APT_PKG_EXPOSE_STRING_VIEW +#include +#endif #include #include @@ -75,7 +78,9 @@ bool StrToNum(const char *Str,unsigned long long &Res,unsigned Len,unsigned Base bool Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len); bool Base256ToNum(const char *Str,unsigned long long &Res,unsigned int Len); bool Hex2Num(const std::string &Str,unsigned char *Num,unsigned int Length); - +#ifdef APT_PKG_EXPOSE_STRING_VIEW +APT_HIDDEN bool Hex2Num(const APT::StringView Str,unsigned char *Num,unsigned int Length); +#endif // input changing string split bool TokSplitString(char Tok,char *Input,char **List, unsigned long ListMax); -- cgit v1.2.3