[lsp] some build performance tuning

When a resource is loaded for the first time, there is no need to unload it between pre-indexing and build
This commit is contained in:
Jan Koehnlein 2019-04-12 10:05:01 +02:00
parent 12991092f9
commit 7ebd587d0c
2 changed files with 2 additions and 3 deletions

View file

@ -94,7 +94,7 @@ class IncrementalBuilder {
val result = indexer.computeAndIndexAffected(request, context)
request.cancelIndicator.checkCanceled
for (delta : result.resourceDeltas) {
if (unloaded.add(delta.uri)) {
if (delta.old !== null && unloaded.add(delta.uri)) {
unloadResource(delta.uri)
}
}

View file

@ -259,8 +259,7 @@ public class IncrementalBuilder {
this._operationCanceledManager.checkCanceled(this.request.getCancelIndicator());
List<IResourceDescription.Delta> _resourceDeltas = result.getResourceDeltas();
for (final IResourceDescription.Delta delta : _resourceDeltas) {
boolean _add_2 = unloaded.add(delta.getUri());
if (_add_2) {
if (((delta.getOld() != null) && unloaded.add(delta.getUri()))) {
this.unloadResource(delta.getUri());
}
}