mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
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:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user