WebKit Bugzilla
Attachment 341017 Details for
Bug 185882
: [POSIX] Use access() instead of stat() in FileSystem::fileExists()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185882-20180522135454.patch (text/plain), 1.79 KB, created by
Chris Dumez
on 2018-05-22 13:54:55 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-22 13:54:55 PDT
Size:
1.79 KB
patch
obsolete
>Subversion Revision: 232076 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6cac44d49e9584cd78bc0987fac07cb6ff17b20e..3ebbaef674a391fac2c91f03b9e87c8f01b1d1e4 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-05-22 Chris Dumez <cdumez@apple.com> >+ >+ [POSIX] Use access() instead of stat() in FileSystem::fileExists() >+ https://bugs.webkit.org/show_bug.cgi?id=185882 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2018-05-22 Keith Miller <keith_miller@apple.com> > > We should have a CoW storage for NewArrayBuffer arrays. >diff --git a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >index 4da7cf6f5cd7daaa0c2f275df813a514040f9feb..de9724aa4a4454ba66cbe3da0a1599b6212f9f48 100644 >--- a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >+++ b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >@@ -58,10 +58,7 @@ bool fileExists(const String& path) > if (!fsRep.data() || fsRep.data()[0] == '\0') > return false; > >- struct stat fileInfo; >- >- // stat(...) returns 0 on successful stat'ing of the file, and non-zero in any case where the file doesn't exist or cannot be accessed >- return !stat(fsRep.data(), &fileInfo); >+ return access(path, F_OK) != -1; > } > > bool deleteFile(const String& path)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185882
:
341015
|
341017
|
341020