perf: skip quick_check for only one provider

The 'quick_check' increases the amount of time it takes to perform a
stat operation significantly proportional to the time it takes to do
a stat because an fsentry fetch occurs before a transient
memoization map is available for an operation.
This commit is contained in:
KernelDeimos
2025-09-13 20:19:01 -04:00
parent 915358cec4
commit 6a129ba8cc
@@ -88,6 +88,14 @@ class MountpointService extends BaseService {
}
async get_provider (selector) {
// If there is only one provider, we don't need to do any of this,
// and that's a big deal because the current implementation requires
// fetching a filesystem entry before we even have operation-level
// transient memoization instantiated.
if ( Object.keys(this.mountpoints_).length === 1 ) {
return Object.values(this.mountpoints_)[0].provider;
}
try_infer_attributes(selector);
if ( selector instanceof RootNodeSelector ) {