perf: PersistentStorage::getGraphForAll - avoiding second sqlite call. (#890)

* perf: PersistentStorage::getGraphForAll - avoiding second sqlite call.

* std::map -> std::unordered_map for m_symbolDefinitionKinds.

* src: Added PersistentStorage::addFileNodeToGraph.

* src: Refactor and Bugfixes in new implementation of getGraphForAll.

* std::map -> std::unordered_map for m_fileNodeIndexed.
* Added PersistentStorage::addNodeToGraph.
This commit is contained in:
technateNG
2020-01-29 18:30:22 +01:00
committed by GitHub
parent 8cc4aaf6ea
commit 9d26104d2f
2 changed files with 65 additions and 53 deletions
+4 -3
View File
@@ -241,7 +241,8 @@ private:
const std::vector<Id>& edgeIds,
Graph* graphh,
bool addChildCount) const;
inline void addFileNodeToGraph(const StorageNode& storageNode, Graph* const graph) const;
void addNodeToGraph(const StorageNode& newNode, const NodeType& type, Graph* graph, bool addChildCount) const;
void addAggregationEdgesToGraph(
Id nodeId, const std::vector<StorageEdge>& edgesToAggregate, Graph* graph) const;
void addFileContentsToGraph(Id fileId, Graph* graph) const;
@@ -276,10 +277,10 @@ private:
std::map<FilePath, Id> m_lowerCasefileNodeIds;
std::map<Id, FilePath> m_fileNodePaths;
std::map<Id, bool> m_fileNodeComplete;
std::map<Id, bool> m_fileNodeIndexed;
std::unordered_map<Id, bool> m_fileNodeIndexed;
std::map<Id, std::wstring> m_fileNodeLanguage;
std::map<Id, DefinitionKind> m_symbolDefinitionKinds;
std::unordered_map<Id, DefinitionKind> m_symbolDefinitionKinds;
std::map<Id, Id> m_memberEdgeIdOrderMap;
HierarchyCache m_hierarchyCache;