exception_ptr -> exception_wrapper migration
authorJames Sedgwick <jsedgwick@fb.com>
Thu, 8 Jan 2015 15:48:23 +0000 (07:48 -0800)
committerViswanath Sivakumar <viswanath@fb.com>
Tue, 13 Jan 2015 19:01:05 +0000 (11:01 -0800)
commit352bbea652ce674fca3e5d8696215bfc88458753
treeba777a3377f54d42aba439a2cef0862d5018dccc
parent06cee07154791d7016047d8f83f59d052568752d
exception_ptr -> exception_wrapper migration

Summary:
integrate exception_wrapper everywhere, and deprecate public methods that take ptrs directly to discourage their use
note that this will break for throwing non-exceptions, which is probably fine

this change opens the door to interesting optimizations for those interested, e.g. Future::then<Exn1, Exn2>(/* func throwing Exn1 and Exn2 */) that autowraps the given types into the resultant future

new benchmark:
```
throwAndCatch                                               23.69us   42.21K
throwAndCatchWrapped                             119.53%    19.82us   50.45K
throwWrappedAndCatchWrapped                      350.16%     6.77us  147.80K
```

Test Plan: existing unit tests, suspected potential perf wins confirmed by benchmark, will wait for windtunnel to see other wins/regressions

Reviewed By: hans@fb.com

Subscribers: search-fbcode-diffs@, apodsiadlo, alikhtarov, andrii, trunkagent, fugalh, njormrod, folly-diffs@, bmatheny

FB internal diff: D1644912

Signature: t1:1644912:1420731849:3dc658dc03bfd6e75d61158808c7dad96092ecfb
12 files changed:
folly/ExceptionWrapper.h
folly/wangle/futures/Future-inl.h
folly/wangle/futures/Future.h
folly/wangle/futures/Promise-inl.h
folly/wangle/futures/Promise.h
folly/wangle/futures/Try-inl.h
folly/wangle/futures/Try.h
folly/wangle/futures/detail/Core.h
folly/wangle/futures/test/Benchmark.cpp
folly/wangle/futures/test/FutureTest.cpp
folly/wangle/futures/test/Interrupts.cpp
folly/wangle/futures/test/Try.cpp