sapling/eden/fs/utils
Xavier Deguillard b7ab05edc5 utils: add an ImmediateFuture type
Summary:
In very hot code path, EdenFS is spending a very large amount of time creating
and destroying folly::Future objects. This is due to the required memory
allocation, as well as the handful of atomics that are happening at creation
time, and these are showing up in EdenFS profiles.

In the steady state, EdenFS actually doesn't need futures, as it often times is
able to service requests from its in-memory caches, in which case we should
ideally just return the value itself and not wrap it in a folly::Future. The
added ImmediateFuture is a step in this direction, as it can hold either an
immediate value, or a folly::SemiFuture, and allow the same API to be used
transparently between these 2.

Reviewed By: genevievehelsel

Differential Revision: D28006802

fbshipit-source-id: 89eaa32e7fa82c44844c4b23c4cb30dbeea46ca8
2021-05-06 10:54:03 -07:00
..
test utils: add an ImmediateFuture type 2021-05-06 10:54:03 -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 Remove folly's ColdClass, which was of dubious utility 2020-01-09 13:09:56 -08:00
CaseSensitivity.h utils: introduce CaseSensitivity 2021-04-20 13:08: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
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 Apply clang-format update fixes 2021-01-10 10:06:29 -08:00
FileDescriptor.h eden: introduce SpawnedProcess 2020-09-01 13:31:32 -07:00
FileUtils.cpp utils: truncate nul bytes after obtaining a temp file name 2020-10-22 16:24:17 -07:00
FileUtils.h win: move win/utils onto utils/ 2020-09-22 09:09:56 -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: add an ImmediateFuture type 2021-05-06 10:54:03 -07:00
ImmediateFuture-pre.h utils: add an ImmediateFuture type 2021-05-06 10:54:03 -07:00
ImmediateFuture.h utils: add an ImmediateFuture type 2021-05-06 10:54:03 -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
NotImplemented.h move EdenError to utils/ 2021-02-23 19:58:03 -08:00
PathFuncs.cpp utils: expand AbsolutePathBase to provide some filesystem related methods via Boost 2021-04-23 15:22:09 -07:00
PathFuncs.h utils: expand AbsolutePathBase to provide some filesystem related methods via Boost 2021-04-23 15:22:09 -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 remove dependency on glog 2020-11-10 16:31:15 -08:00
ProcessAccessLog.h remove dependency on glog 2020-11-10 16:31:15 -08: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 utils: add an RcuPtr class 2020-12-11 14:10:58 -08:00
SortedInsert.h Tidy up license headers 2019-10-11 05:28:23 -07:00
SpawnedProcess.cpp use getGlobalIOExecutor instead of getIOExecutor 2021-04-21 22:13:53 -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 remove dependency on glog 2020-11-10 16:31:15 -08: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 eden: use SpawnedProcess to start privhelper 2020-09-18 17:22:39 -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