You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
optimize _updateLocalClasses in Inspector Service #4393
_updateLocalClasses fetches each of the objects individually. This causes a performance bottleneck on pub root directory change.
If this class ends up being needed, the we will need to find a call that batches the request, to avoid overloading the vm with rpc calls.
NOTE:isLocalClass may not be hooked up to the fronted properly yet. So doing this optimization may not be needed until that is accomplished
final isolate = inspectorLibrary.isolate!;
final futures = <Future>[];
for (final libraryRef in isolate.libraries!) {
if (isLocalUri(libraryRef.uri!)) {
final future = inspectorLibrary.service.getObject(
isolate.id!, libraryRef.id!
).then((result) {
final library = result as Library;
for (final classRef in library.classes!) {
localClasses[classRef.name!] = classRef;
}
});
futures.add(future);
}
}
await Future.wait(futures);
It looks like _updateLocalClasses and the associated rootPackages logic in InspectorService were removed in #7175, so this optimization is no longer applicable.
Activity
[-]optimize isLocalClass in Inspector Service[/-][+]optimize `_updateLocalClasses` in Inspector Service[/+]CoderDake commentedon Aug 19, 2022
Ben recommends
as a temporary measure, although we may still need to find a batch approach long term
https://github.com/flutter/devtools/pull/4394/files#r950499503
johnpryan commentedon Oct 22, 2026
It looks like
_updateLocalClassesand the associatedrootPackageslogic inInspectorServicewere removed in #7175, so this optimization is no longer applicable.