NSPathControl Causing Disk I/O Reading NSURL Resource Values On the Main Thread

Sort of a continuation of - https://developer.apple.com/forums/thread/813641

I've made a great effort to get NSURL -getResourceValue:forKey: calls etc off the main thread. Great progress. So now I'm working with a file on a really slow network volume I discovered a little hang and luckily enough I'm attached to the debugger so I paused that thing. I see where I'm at. It is:

NSPathControl's setURL:. It goes a little something like this:

in realpath$DARWIN_EXTSN ()

+fileSystemRealPath ()

+[FSNode(SandboxChecks) canAccessURL:withAuditToken:operation:] ()

+FSNode(SandboxChecks) canReadFromSandboxWithAuditToken:] ()

LaunchServices::URLPropertyProvider::prepareLocalizedNameValue ()

LaunchServices::URLPropertyProvider::prepareValues () prepareValuesForBitmap ()

FSURLCopyResourcePropertiesForKeysInternal ()

CFURLCopyResourcePropertiesForKeys ()

-[NSURL resourceValuesForKeys:error:] () in function signature specialization <Arg[1] = Dead> of Foundation._NSFileManagerBridge.displayName(atPath: Swift.String) -> Swift.String () in displayName ()

-[NSPathCell _autoUpdateCellContents] ()

-[NSPathCell setURL:] ()

Could maybe, NSPathControl get the display name etc. asynchronously? and maybe just stick raw path components in as a placeholder while it is reading async? Or something like that? If I can preload the resource keys it needs I would but once the NSURL asks on the main main thread I think it will just dump the cache out, per the run loop rules.

FB22294400

NSPathControl Causing Disk I/O Reading NSURL Resource Values On the Main Thread
 
 
Q