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
Currently if you call NSString's `standardizingPath`, you end up calling FileManager's `attributesOfItem` API. This call calls some system API, specifically `getpwuid` and `getgrgid`. These can take a huge amount of time to complete, and the result of them isn't needed in this case, since the only thing we need to know is if the path is a symlink.
In this case it would much faster to directly call lstat, or a different version of `attributesOfItem` that didn't fetch these unused attributes.
In our case, removing this from an IO heavy CLI took run time for some operations from 18 minutes to 4 seconds.
Attached is a flame graph captured using perf with an example (it can be viewed in Safari).
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: 2c4295836ad4a7d07ca26d25e1a3c884
Issue Description:
Currently if you call NSString's `standardizingPath`, you end up calling FileManager's `attributesOfItem` API. This call calls some system API, specifically `getpwuid` and `getgrgid`. These can take a huge amount of time to complete, and the result of them isn't needed in this case, since the only thing we need to know is if the path is a symlink.
In this case it would much faster to directly call lstat, or a different version of `attributesOfItem` that didn't fetch these unused attributes.
In our case, removing this from an IO heavy CLI took run time for some operations from 18 minutes to 4 seconds.
Attached is a flame graph captured using perf with an example (it can be viewed in Safari).
The text was updated successfully, but these errors were encountered: