• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads


  • Subject: Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads
  • From: Rob Petrovec via Cocoa-dev <email@hidden>
  • Date: Sun, 19 Apr 2020 10:16:55 -0600

I assume you have iCloud enabled.  If so, these three folders are ’special’.
Try logging out of iCloud & rebooting and see if the problem persists.

I would also recommend filing a bug with Apple and include a sysdiagnose taken
while the problem was reproducing (sudo sysdiagnose).  Or at least a spindump
(sudo spindump) while the problem is reproducing.

—Rob



> On Apr 19, 2020, at 9:54 AM, David M. Cotter via Cocoa-dev
> <email@hidden> wrote:
>
> this may be difficult for other to repro
>
> i have discovered it may have to do with permissions / entitlements that have
> been granted the app by the user, and that resetting all perms to default
> will "fix" the problem
>
> in the terminal, do this:
>> tccutil reset All
> i expect that after that, your delay will disappear.
>
> however, you'll have to manually re-authorize all apps in the system
> prefs->security & privacy->privacy tab
>
> i realize this is a "sweep the problem under the rug" rather than "fix the
> problem" approach
> but hopefully this should give someone else a clue as to WHY this is
> happening?
>
> -dave
>
>> On Apr 19, 2020, at 8:08 AM, Allan Odgaard via Cocoa-dev
>> <email@hidden> wrote:
>>
>> Starting with macOS 10.15 I have noticed that obtaining
>> NSURLLocalizedNameKey, NSURLTagNamesKey, and even calling getxattr(), can
>> cause a significant delay.
>>
>> The code below, which gets NSURLLocalizedNameKey for 3 folders, takes 1.9
>> seconds to execute on my system.
>>
>> It appears though that it is only these 3 specific folders that has the
>> problem.
>>
>> Furthermore, the problem only happens when I include the code below in a GUI
>> application which is launched via launch services. If I run the executable
>> directly from a terminal then the code is near instant.
>>
>> I tried to sample the code, and it appears that it calls out to some OS
>> service/daemon. Presumably it never gets a response, and a timeout is
>> triggered.
>>
>> I wonder if anyone else has come across this? And maybe have discovered more
>> info?
>>
>> This is btw macOS 10.15.4 and a fairly stock system (new computer without
>> migrating old data), and I noticed the problem some time ago, so it
>> definitely existed before 10.15.4, but I never saw anything like this before
>> upgrading to Catelina.
>>
>>   NSTimeInterval startTime = NSDate.timeIntervalSinceReferenceDate;
>>
>>   NSArray<NSURL*>* urls = @[]
>>       [NSFileManager.defaultManager URLForDirectory:NSDesktopDirectory
>> inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil],,
>>       [NSFileManager.defaultManager URLForDirectory:NSDocumentDirectory
>> inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]
>>       [NSFileManager.defaultManager URLForDirectory:NSDownloadsDirectory
>> inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil,
>>   ];
>>
>>   NSString* localizedName;
>>   for(NSURL* url in urls)
>>       [url getResourceValue:&localizedName forKey:NSURLLocalizedNameKey
>> error:nil];
>>
>>   NSLog(@"Duration %.03f", NSDate.timeIntervalSinceReferenceDate -
>> startTime);
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads (From: Allan Odgaard via Cocoa-dev <email@hidden>)
 >Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads (From: "David M. Cotter via Cocoa-dev" <email@hidden>)

  • Prev by Date: Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads
  • Next by Date: Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads
  • Previous by thread: Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads
  • Next by thread: Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads
  • Index(es):
    • Date
    • Thread