Changeset 232088 in webkit
- Timestamp:
- May 22, 2018 4:54:04 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r232081 r232088 1 2018-05-22 Chris Dumez <cdumez@apple.com> 2 3 [POSIX] Use access() instead of stat() in FileSystem::fileExists() 4 https://bugs.webkit.org/show_bug.cgi?id=185882 5 6 Reviewed by Geoffrey Garen. 7 8 Use access() instead of stat() in FileSystem::fileExists(). stat() returns a lot of information we 9 do not leverage and local benchmarking on macOS shows access() being > 80% faster than stat(): 10 stat: 0.31567 (lower is better) 11 access: 0.16074 (lower is better) 12 stat: 0.303665 (lower is better) 13 access: 0.165468 (lower is better) 14 15 * platform/posix/FileSystemPOSIX.cpp: 16 (WebCore::FileSystem::fileExists): 17 1 18 2018-05-22 Brent Fulgham <bfulgham@apple.com> 2 19 -
trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp
r230639 r232088 59 59 return false; 60 60 61 struct stat fileInfo; 62 63 // 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 64 return !stat(fsRep.data(), &fileInfo); 61 return access(fsRep.data(), F_OK) != -1; 65 62 } 66 63
Note: See TracChangeset
for help on using the changeset viewer.