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:
@@ -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++;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user