data: increased parse and graph assembly performance

* removed header search in subdirectories of header search paths
* cache file node ids in Storage for faster lookup
* retrieve node names from SearchIndex
* fixed addNodeAndAllChildren also called for member edges
* added check if node already present in addEdgeAndAllChildren
This commit is contained in:
Eberhard Graether
2015-09-23 09:26:03 +02:00
parent e9d45a507a
commit 78c1b32797
27 changed files with 308 additions and 260 deletions
+20
View File
@@ -35,6 +35,7 @@ void SearchIndex::clear()
{
m_root.m_nodes.clear();
m_dictionary.clear();
m_tokenIds.clear();
}
size_t SearchIndex::getNodeCount() const
@@ -134,6 +135,25 @@ bool SearchIndex::removeNodeIfUnreferencedRecursive(SearchNode* searchNode)
return false;
}
void SearchIndex::addTokenId(SearchNode* node, Id tokenId)
{
node->addTokenId(tokenId);
m_tokenIds.emplace(tokenId, node);
}
NameHierarchy SearchIndex::getNameHierarchyForTokenId(Id tokenId) const
{
std::map<Id, SearchNode*>::const_iterator it = m_tokenIds.find(tokenId);
if (it != m_tokenIds.end())
{
SearchNode* node = it->second;
return node->getNameHierarchy();
}
return NameHierarchy();
}
SearchResults SearchIndex::runFuzzySearch(const std::string& query) const
{
return m_root.runFuzzySearch(query);