Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[POSIX] Use access() instead of stat() in FileSystem::fileExists()
https://bugs.webkit.org/show_bug.cgi?id=185882 Reviewed by Geoffrey Garen. Use access() instead of stat() in FileSystem::fileExists(). stat() returns a lot of information we do not leverage and local benchmarking on macOS shows access() being > 80% faster than stat(): stat: 0.31567 (lower is better) access: 0.16074 (lower is better) stat: 0.303665 (lower is better) access: 0.165468 (lower is better) * platform/posix/FileSystemPOSIX.cpp: (WebCore::FileSystem::fileExists): Canonical link: https://commits.webkit.org/201337@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
18 additions
and 4 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
@@ -58,10 +58,7 @@ bool fileExists(const String& path) | ||
if (!fsRep.data() || fsRep.data()[0] == '\0') | ||
return false; | ||
|
||
return access(fsRep.data(), F_OK) != -1; | ||
} | ||
|
||
bool deleteFile(const String& path) | ||