-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make deleteTreesBelow faster by assuming that the directories to be deleted are readable and writable. We create most of the trees we delete via this function anyway, so we know that they are accessible for the most part. The previous code was blindly resetting read/write/execute permissions for each traversed directory, and was doing so individually, which means we issued 3 extra syscalls per directory. And on Unix file systems, go even further by taking advantage of the fact that readdir returns the type of each entry: there is no need to issue a separate stat for each entry to determine if it is a subdirectory or not. Do this from our JNI code because there really is no reason to pay the cost of going in an out of Java for each file: we are traversing very large directory trees, so every bit helps. A fully-local build of a large iOS app on a Mac Pro 2013 shows that this reduces build times from about 7300s to 5100s. A build of a similar app on a MacBook Pro 2015 shows a reduction from 7500s to 5400s. The impact on these builds using dynamic execution is much smaller, and there is no observable improvement in smaller builds. Addresses #7527. RELNOTES: None. PiperOrigin-RevId: 239594433
- Loading branch information
1 parent
074c9c4
commit fac322b
Showing
4 changed files
with
274 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters