From: Krzysztof Parzyszek Date: Wed, 19 Apr 2017 15:12:44 +0000 (+0000) Subject: [RDF] Switch NodeList to SmallVector from std::vector X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad6758286adb61f8fe86955f0261debb5bfccb10;p=llvm [RDF] Switch NodeList to SmallVector from std::vector The list has a single element 75+% of the time, reservation of 4 elements is sufficient in 95% of cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300705 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/RDFGraph.h b/lib/Target/Hexagon/RDFGraph.h index d5faca4cd6f..52f390356b2 100644 --- a/lib/Target/Hexagon/RDFGraph.h +++ b/lib/Target/Hexagon/RDFGraph.h @@ -508,7 +508,8 @@ namespace rdf { static_assert(sizeof(NodeBase) <= NodeAllocator::NodeMemSize, "NodeBase must be at most NodeAllocator::NodeMemSize bytes"); - typedef std::vector> NodeList; +// typedef std::vector> NodeList; + typedef SmallVector,4> NodeList; typedef std::set NodeSet; struct RefNode : public NodeBase {