sapling/eden/fs/utils
Xavier Deguillard a49e86d091 utils: speedup ImmediateFuture::thenValue exception case by 78x
Summary:
Exception cases should be rare, but EdenFS has a couple of spots where
exceptions are somewhat expected. One of which being a lookup failure due to a
non-existing file. Due to the overhead of these lookup failures, EdenFS is
actually spending as much time resolving these, than resolving successful
lookups.

The reason for the high overhead is due to the ImmediateFuture::thenValue just
relying on an exception being thrown when accessing the stored Try value. We
can do better than this by testing the Try before hand, and bailing out in that
case.

Reviewed By: fanzeyi

Differential Revision: D31655223

fbshipit-source-id: 29da7ef38a19f09c91c931e7e8e080e5ed6af269
2021-10-15 17:50:18 -07:00
..
test immediatefuture: add a collectAll function 2021-10-14 18:58:43 -07:00
BucketedLog.h remove dependency on glog 2020-11-10 16:31:15 -08:00
BufVec.h fuse: move BufVec.h to utils/ 2020-09-02 12:15:48 -07:00
Bug.cpp refactor the EDEN_BUG() macro 2019-11-22 15:38:33 -08:00
Bug.h utils: EDEN_BUG_FUTURE returns a Try<T> 2021-05-13 16:51:34 -07:00
CaseSensitivity.h service: key mount map with an AbsolutePath 2021-06-09 21:34:27 -07:00
ChronoParse.cpp Replace Folly Format with fmt in logger to reduce binary size 2019-11-18 05:53:08 -08:00
ChronoParse.h Tidy up license headers 2019-10-11 05:28:23 -07:00
ChronoUnit.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
ChronoUnit.gperf update license header in remaining files 2019-06-19 17:02:46 -07:00
ChronoUnit.h Tidy up license headers 2019-10-11 05:28:23 -07:00
Clock.cpp utils: remove UnixClock::getElapsedTimeInNs 2020-09-30 15:50:08 -07:00
Clock.h utils: remove UnixClock::getElapsedTimeInNs 2020-09-30 15:50:08 -07:00
CMakeLists.txt utils: add stack trace for Windows 2021-04-23 13:20:46 -07:00
CoverageSet.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
CoverageSet.h Tidy up license headers 2019-10-11 05:28:23 -07:00
DirType.cpp assert that the dtype constants have consistent values on all platforms 2020-04-28 13:23:52 -07:00
DirType.h utils: define symlink type for Windows 2021-04-29 13:17:54 -07:00
EdenError.cpp move EdenError to utils/ 2021-02-23 19:58:03 -08:00
EdenError.h move EdenError to utils/ 2021-02-23 19:58:03 -08:00
EdenTaskQueue.cpp create util EdenTaskQueue from NfsTaskQueue 2021-06-29 09:45:46 -07:00
EdenTaskQueue.h create util EdenTaskQueue from NfsTaskQueue 2021-06-29 09:45:46 -07:00
EnumValue.h add enumValue utility function 2020-04-28 17:41:24 -07:00
FaultInjector.cpp build deprecation-clean 2019-11-12 16:31:54 -08:00
FaultInjector.h Tidy up license headers 2019-10-11 05:28:23 -07:00
FileDescriptor.cpp Fix warning on FileDescriptor.cpp 2021-05-25 19:45:22 -07:00
FileDescriptor.h eden: introduce SpawnedProcess 2020-09-01 13:31:32 -07:00
FileUtils.cpp explicit Hash20 instead of Hash [proxy hash removal 2/n] 2021-10-01 12:43:26 -07:00
FileUtils.h explicit Hash20 instead of Hash [proxy hash removal 2/n] 2021-10-01 12:43:26 -07:00
Future.h add a collectSafe function 2020-02-03 11:30:50 -08:00
FutureUnixSocket.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
FutureUnixSocket.h Tidy up license headers 2019-10-11 05:28:23 -07:00
Guid.h win: re-use guid for the lifetime of the checkout 2020-12-15 08:07:49 -08:00
Handle.h remove dependency on glog 2020-11-10 16:31:15 -08:00
IDGen.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
IDGen.h Tidy up license headers 2019-10-11 05:28:23 -07:00
ImmediateFuture-inl.h utils: speedup ImmediateFuture::thenValue exception case by 78x 2021-10-15 17:50:18 -07:00
ImmediateFuture-pre.h utils: handle void lambda in ImmediateFuture 2021-05-17 14:07:29 -07:00
ImmediateFuture.h immediatefuture: add a collectAll function 2021-10-14 18:58:43 -07:00
IoFuture.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
IoFuture.h Tidy up license headers 2019-10-11 05:28:23 -07:00
LazyInitialize.h Tidy up license headers 2019-10-11 05:28:23 -07:00
LeaseCache.h Tidy up license headers 2019-10-11 05:28:23 -07:00
MappedDiskVector.h fix compilation error of missing type 2021-03-15 22:31:25 -07:00
Memory.cpp introduce an assertZeroBits function to double-check the compiler 2020-09-13 01:37:14 -07:00
Memory.h introduce an assertZeroBits function to double-check the compiler 2020-09-13 01:37:14 -07:00
NfsSocket.cpp nfs: allow mountd and nfsd to bind to a unix socket on macOS 2021-05-12 13:06:57 -07:00
NfsSocket.h nfs: allow mountd and nfsd to bind to a unix socket on macOS 2021-05-12 13:06:57 -07:00
NotImplemented.h move EdenError to utils/ 2021-02-23 19:58:03 -08:00
PathFuncs.cpp store: diff should respect the mount case sensitivity 2021-07-29 11:29:42 -07:00
PathFuncs.h store: diff should respect the mount case sensitivity 2021-07-29 11:29:42 -07:00
PathMap.h utils: introduce CaseSensitivity 2021-04-20 13:08:27 -07:00
Pipe.cpp eden: introduce FileDescriptor and Pipe types 2020-09-01 13:31:32 -07:00
Pipe.h eden: introduce FileDescriptor and Pipe types 2020-09-01 13:31:32 -07:00
ProcessAccessLog.cpp collect memory and disk fetch counts 2021-07-21 21:37:20 -07:00
ProcessAccessLog.h collect memory and disk fetch counts 2021-07-21 21:37:20 -07:00
ProcessNameCache.cpp make msvc happy 2021-04-13 14:34:41 -07:00
ProcessNameCache.h utils: compile ProcessAccessLog and ProcessNameCache on Windows 2020-09-04 16:14:25 -07:00
ProcUtil.cpp Remove dead includes in eden 2020-10-09 15:25:47 -07:00
ProcUtil.h utils: add a platform independent FileUtils 2020-08-14 18:56:33 -07:00
Rcu.h synchronize getClient in scs metadata importer 2021-07-29 09:56:24 -07:00
SortedInsert.h Tidy up license headers 2019-10-11 05:28:23 -07:00
SpawnedProcess.cpp utils: mark SpawnedProcess as being waited when waitpid fails 2021-09-13 20:00:45 -07:00
SpawnedProcess.h eden: introduce SpawnedProcess 2020-09-01 13:31:32 -07:00
SSLContext.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
SSLContext.h Tidy up license headers 2019-10-11 05:28:23 -07:00
StatTimes.h eden: add stattimes helpers for win32 2020-04-24 15:57:27 -07:00
StringConv.cpp utils: move multibyteToWideString to a cpp file 2020-09-30 16:29:13 -07:00
StringConv.h utils: move multibyteToWideString to a cpp file 2020-09-30 16:29:13 -07:00
Synchronized.h Tidy up license headers 2019-10-11 05:28:23 -07:00
SystemError.h Tidy up license headers 2019-10-11 05:28:23 -07:00
Thread.cpp fs: ifdef linux/macos only files 2020-09-23 12:20:41 -07:00
Thread.h disable pthread cancellation on the FuseChannel threads 2020-05-08 20:41:50 -07:00
TimeUtil.cpp replace most folly:format uses 2021-09-20 16:23:22 -07:00
TimeUtil.h Tidy up license headers 2019-10-11 05:28:23 -07:00
UnboundedQueueExecutor.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
UnboundedQueueExecutor.h Tidy up license headers 2019-10-11 05:28:23 -07:00
UnixSocket.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
UnixSocket.h edenfs: remove use of fork from StartupLogger 2020-09-18 17:22:39 -07:00
UserInfo.cpp win: move win/utils onto utils/ 2020-09-22 09:09:56 -07:00
UserInfo.h Not use gtest for UserInfo.h on Windows 2021-05-25 23:55:08 -07:00
Utf8.cpp utils: add a constexpr utf8 checker 2020-12-16 01:03:32 -08:00
Utf8.h utils: add a constexpr utf8 checker 2020-12-16 01:03:32 -08:00
WinError.cpp Back out "prjfs: handle concurrent file/directory removal" 2020-12-10 07:42:38 -08:00
WinError.h edenfs: move WinError to eden/fs/utils 2020-09-17 09:08:58 -07:00
WinStackTrace.cpp utils: add stack trace for Windows 2021-04-23 13:20:46 -07:00
WinStackTrace.h utils: add stack trace for Windows 2021-04-23 13:20:46 -07:00
XAttr.cpp fs: ifdef linux/macos only files 2020-09-23 12:20:41 -07:00
XAttr.h Tidy up license headers 2019-10-11 05:28:23 -07:00