logic: Improved graph and code view performance

* added sql index for component_access
* improved policy for expanded code files
* reduced amount of initially expanded code files
* faster DummyEdge creation
* faster DummyNode search by token id
* switched GraphController DummyNodes and DummyEdges to shared_ptr for memory safety
This commit is contained in:
Eberhard Graether
2016-05-21 00:01:46 +02:00
parent 4a6f8cf420
commit 5d2a476813
13 changed files with 335 additions and 346 deletions
@@ -303,6 +303,7 @@ std::vector<CodeSnippetParams> CodeController::getSnippetsForActiveTokenLocation
) const {
std::vector<CodeSnippetParams> snippets;
size_t definitionFileCount = 0;
size_t declarationFileCount = 0;
collection->forEachTokenLocationFile(
[&](std::shared_ptr<TokenLocationFile> file) -> void
@@ -324,7 +325,9 @@ std::vector<CodeSnippetParams> CodeController::getSnippetsForActiveTokenLocation
}
);
if (definitionFileCount < 5 && (isDeclarationFile || collection->getTokenLocationFileCount() < 5 || file->isWholeCopy))
if (collection->getTokenLocationFileCount() < 5 || file->isWholeCopy ||
(isDefinitionFile && definitionFileCount < 3) ||
(!isDefinitionFile && isDeclarationFile && declarationFileCount < 3))
{
std::vector<CodeSnippetParams> fileSnippets = getSnippetsForActiveTokenLocationsInFile(file);
@@ -350,6 +353,10 @@ std::vector<CodeSnippetParams> CodeController::getSnippetsForActiveTokenLocation
{
definitionFileCount++;
}
else if (isDeclarationFile)
{
declarationFileCount++;
}
}
);