1. 26 Jun, 2015 4 commits
    • Hans Fugal's avatar
      (easy) remove cruft comment · 17751e04
      Hans Fugal authored
      Summary: We have this now.
      
      Reviewed By: @jsedgwick
      
      Differential Revision: D2191642
      17751e04
    • Hannes Roth's avatar
      (Wangle) Fix possible race in updating FSM state · 11e76315
      Hannes Roth authored
      Summary: Storing the new state could be a memory race according to C++ (but wasn't in practice). I only checked GCC though.
      
      Reviewed By: @nbronson
      
      Differential Revision: D2189287
      11e76315
    • Hannes Roth's avatar
      (Wangle) Clean up some data races in tests · e51d8547
      Hannes Roth authored
      Summary: Not 100% about the `ThreadWheelTimekeeper` test. It makes TSAN happy
      though.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2187901
      e51d8547
    • Hannes Roth's avatar
      (Wangle) Fix bug with CrappyExecutors, and bad PriorityExecutor · be983813
      Hannes Roth authored
      Summary: 1) We forgot to `--attached_` if `x` throws an exception
      2) `PriorityExecutor` didn't execute `Func`, causing leaks in the test (not a bug in Futures)
      3) I moved up the initialization for an empty `Core` into the constructor to make it easier to see
      
      Reviewed By: @jsedgwick
      
      Differential Revision: D2187343
      be983813
  2. 24 Jun, 2015 10 commits
    • Sara Golemon's avatar
      Don't hardcode thread limit in ServerBootstrap · 2c111cff
      Sara Golemon authored
      Summary: This was set to 32 which probably works fine for the
      majority of FB servers, but not everyone's system is so endowed.
      
      Closes #119
      
      Reviewed By: @fredemmott
      
      Differential Revision: D2187008
      2c111cff
    • Hannes Roth's avatar
      (Wangle) Remove unnecessary constructor argument to CollectAnyContext · 5637418f
      Hannes Roth authored
      Summary: See title.
      
      Reviewed By: @fugalh
      
      Differential Revision: D2186833
      5637418f
    • Sara Golemon's avatar
      Fix tests for glog and gflags · c6b30787
      Sara Golemon authored
      Summary: The existing tests were trying to find undocumented
      symbols in glog/glags which aren't guaranteed to be there on all
      platforms.
      
      Use AC_RUN_IFELSE() to try building and executing some code
      typical of the usage of these libraries.
      
      Closes #117
      
      Reviewed By: @JoelMarcey
      
      Differential Revision: D2183526
      c6b30787
    • Sara Golemon's avatar
      Change visibility of folly::Arena constructors to public · 4514c06c
      Sara Golemon authored
      Summary: In the case of the copy constructor, this change
      doesn't really matter, since it's deleted anyway.
      
      In the case of the move constructor, it fixes what was probably
      an unintentional hiding.  The class certainly looks like
      it supports moving.
      
      Closes #121
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2184131
      4514c06c
    • Sara Golemon's avatar
      Fix copy/pasta in docs · 65eadfc8
      Sara Golemon authored
      Summary: svformat explicitly takes a container for direct indexing,
      but the format string used is per-arg, which corresponds to format/sformat.
      
      Closes #228
      
      Reviewed By: @JoelMarcey
      
      Differential Revision: D2184334
      65eadfc8
    • Sara Golemon's avatar
      Update README.md to refer to homebrew Formula · bdcabdb4
      Sara Golemon authored
      Summary: Release builds should probably favor using
      @marpaia's brew Formula to get a release build.
      
      Leave the boostrap script around to simplify building
      from master.
      
      Closes #229
      
      Reviewed By: @jwatzman
      
      Differential Revision: D2184416
      bdcabdb4
    • Hannes Roth's avatar
      (Wangle) Possibly undefined behavior in collect · fa331472
      Hannes Roth authored
      Summary: Not sure if this is really undefined behavior or whether UBSAN is just super paranoid. Will try to read up on it later.
      
      I also changed some other `std::atomic` initialization to always follow the same pattern, let me know if I should revert those. I couldn't resist, OCD kicked in.
      
      idonthaveocd
      
      Reviewed By: @fugalh
      
      Differential Revision: D2181074
      fa331472
    • Sara Golemon's avatar
      Provide backfill s6_addr16 on BSD platforms · cc89faa3
      Sara Golemon authored
      Summary: Extend the MacOS s6_addr16 hack to Net/Open/FreeBSD
      
      Closes #106
      
      Reviewed By: @JoelMarcey
      
      Differential Revision: D2182912
      cc89faa3
    • Anton Likhtarov's avatar
      Futex: ignore errors on wake · 75bad626
      Anton Likhtarov authored
      Summary: See the comment for details
      
      Reviewed By: @nbronson
      
      Differential Revision: D2181231
      75bad626
    • James Sedgwick's avatar
      rearrange Pipeline to have more functionality in PipelineBase · e4b8b76f
      James Sedgwick authored
      Summary: This way, handlers can carry out more complex manipulations of the pipeline via ctx->getPipeline() without knowing the R/W types
      
      Reviewed By: @djwatson
      
      Differential Revision: D2158736
      e4b8b76f
  3. 23 Jun, 2015 3 commits
  4. 22 Jun, 2015 3 commits
    • Igor Sugak's avatar
      Add missing override and remove redundant virtual in folly · 7f22ad99
      Igor Sugak authored
      Summary: Running clang-tidy to fix this problem, using script D2171334.
      
      I noticed that even without this change clang dev build succeeds for folly and opened a separate task to investigate why.
      
      Reviewed By: @markisaa
      
      Differential Revision: D2179299
      7f22ad99
    • Mike Kaplinskiy's avatar
      Add ./configure check for vsnprintf returning negative on error · 61a1244e
      Mike Kaplinskiy authored
      Summary: This is slightly more correct than assuming that
      __APPLE__ is the only place this assumption breaks.
      
      Pulled from relevant section of folly-PR#95, other sections
      are either already applied by other fixes, or have been code-moved.
      
      Closes #95
      
      Reviewed By: @jwatzman
      
      Differential Revision: D2178439
      61a1244e
    • Adriano Melo's avatar
      Building instructions for MAC OS X (MacPorts) · 33f2a1c9
      Adriano Melo authored
      Summary: Tested on Mac OS X 10.10.3 and MacPorts 2.3.3.
      Closes #227
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2176700
      
      Pulled By: @sgolemon
      33f2a1c9
  5. 21 Jun, 2015 2 commits
    • Sara Golemon's avatar
      Bump version to 47:0 · 77f37d5d
      Sara Golemon authored
      77f37d5d
    • Yoni Lavi's avatar
      new small_vector tests that fail on trunk and uncover a bug in emplace_back on... · bd51c8db
      Yoni Lavi authored
      new small_vector tests that fail on trunk and uncover a bug in emplace_back on references to memory inside the vector + a fix + perf improvement to const lvalue push_back
      
      Summary: emplace_back() on a small_vector applied on data inside the vector doesn't work properly.
      In standard vectors, this usage is required to work properly, but I'm not sure whether it should in small_vector. Consider fixing / adding a lint rule.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2122931
      bd51c8db
  6. 19 Jun, 2015 5 commits
  7. 17 Jun, 2015 3 commits
    • James Sedgwick's avatar
      use Unit in Pipeline · 1137f4b8
      James Sedgwick authored
      Summary: Instead of the one-off Nothing struct
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2158621
      1137f4b8
    • James Sedgwick's avatar
      various perf improvements · ca1e87ed
      James Sedgwick authored
      Summary: Three strategies
      1. Optimistic locking
      2. Acquire-release memory ordering instead of full sequential consistency
      3. Some low-hanging branch miss optimizations
      
      Please review carefully; the dogscience is strong with this one
      
      ```
      Before:
      
      ============================================================================
      folly/futures/test/Benchmark.cpp                relative  time/iter  iters/s
      ============================================================================
      constantFuture                                             127.99ns    7.81M
      promiseAndFuture                                  94.89%   134.89ns    7.41M
      withThen                                          28.40%   450.63ns    2.22M
      ----------------------------------------------------------------------------
      oneThen                                                    446.68ns    2.24M
      twoThens                                          58.35%   765.55ns    1.31M
      fourThens                                         31.87%     1.40us  713.41K
      hundredThens                                       1.61%    27.78us   35.99K
      ----------------------------------------------------------------------------
      no_contention                                                4.63ms   216.00
      contention                                        80.79%     5.73ms   174.52
      ----------------------------------------------------------------------------
      throwAndCatch                                               10.91us   91.64K
      throwAndCatchWrapped                             127.14%     8.58us  116.51K
      throwWrappedAndCatch                             178.22%     6.12us  163.32K
      throwWrappedAndCatchWrapped                      793.75%     1.37us  727.38K
      ----------------------------------------------------------------------------
      throwAndCatchContended                                        1.35s  741.33m
      throwAndCatchWrappedContended                    139.18%   969.23ms     1.03
      throwWrappedAndCatchContended                    169.51%   795.76ms     1.26
      throwWrappedAndCatchWrappedContended            17742.23%     7.60ms   131.53
      ----------------------------------------------------------------------------
      complexUnit                                                127.50us    7.84K
      complexBlob4                                     100.14%   127.32us    7.85K
      complexBlob8                                     100.16%   127.30us    7.86K
      complexBlob64                                     96.45%   132.19us    7.57K
      complexBlob128                                    92.83%   137.35us    7.28K
      complexBlob256                                    87.79%   145.23us    6.89K
      complexBlob512                                    81.64%   156.18us    6.40K
      complexBlob1024                                   72.54%   175.76us    5.69K
      complexBlob2048                                   58.52%   217.89us    4.59K
      complexBlob4096                                   32.54%   391.78us    2.55K
      ============================================================================
      
      After:
      ============================================================================
      folly/futures/test/Benchmark.cpp                relative  time/iter  iters/s
      ============================================================================
      constantFuture                                              85.28ns   11.73M
      promiseAndFuture                                  88.63%    96.22ns   10.39M
      withThen                                          30.46%   279.99ns    3.57M
      ----------------------------------------------------------------------------
      oneThen                                                    231.18ns    4.33M
      twoThens                                          60.57%   381.70ns    2.62M
      fourThens                                         33.52%   689.71ns    1.45M
      hundredThens                                       1.49%    15.48us   64.58K
      ----------------------------------------------------------------------------
      no_contention                                                3.84ms   260.19
      contention                                        88.29%     4.35ms   229.73
      ----------------------------------------------------------------------------
      throwAndCatch                                               10.63us   94.06K
      throwAndCatchWrapped                             127.17%     8.36us  119.61K
      throwWrappedAndCatch                             179.83%     5.91us  169.15K
      throwWrappedAndCatchWrapped                     1014.48%     1.05us  954.19K
      ----------------------------------------------------------------------------
      throwAndCatchContended                                        1.34s  749.03m
      throwAndCatchWrappedContended                    140.66%   949.16ms     1.05
      throwWrappedAndCatchContended                    164.87%   809.77ms     1.23
      throwWrappedAndCatchWrappedContended            49406.39%     2.70ms   370.07
      ----------------------------------------------------------------------------
      complexUnit                                                 86.83us   11.52K
      complexBlob4                                      97.42%    89.12us   11.22K
      complexBlob8                                      96.63%    89.85us   11.13K
      complexBlob64                                     92.53%    93.84us   10.66K
      complexBlob128                                    90.85%    95.57us   10.46K
      complexBlob256                                    82.56%   105.17us    9.51K
      complexBlob512                                    74.13%   117.12us    8.54K
      complexBlob1024                                   63.67%   136.37us    7.33K
      complexBlob2048                                   50.25%   172.79us    5.79K
      complexBlob4096                                   26.63%   326.05us    3.07K
      ============================================================================
      ```
      
      Reviewed By: @djwatson
      
      Differential Revision: D2139822
      ca1e87ed
    • Praveen Kumar's avatar
      Using emplace_back to avoid temporary · 16b7f862
      Praveen Kumar authored
      Summary: Directly pass the arguments to respective constructors.
      Instead of first making temporary and then pass that.
      
      Closes #218
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2156978
      
      Pulled By: @sgolemon
      16b7f862
  8. 16 Jun, 2015 3 commits
    • Sara Golemon's avatar
      Bump version to 46:0 · 9f376254
      Sara Golemon authored
      9f376254
    • Sarang Masti's avatar
      Fix leaks in tests · a9a55400
      Sarang Masti authored
      Summary: Fix leaks in unit tests
      
      Reviewed By: @djwatson
      
      Differential Revision: D2153681
      a9a55400
    • Giuseppe Ottaviano's avatar
      Implement previousValue on EliasFanoReader · c1f059de
      Giuseppe Ottaviano authored
      Summary: It is often useful to retrieve the value preceding the current value
      in an Elias-Fano iterator, for example when the list represents
      adjacent ranges. This diff implements a new method `previousValue` in
      `EliasFanoReader`.
      
      It also adds a new `kUnchecked` boolean template argument to
      `EliasFanoReader` which skips bounds checking.
      
      Reviewed By: @philippv
      
      Differential Revision: D2155049
      c1f059de
  9. 15 Jun, 2015 7 commits
    • James Sedgwick's avatar
      pipeline handler removal, fix service test · 31c71948
      James Sedgwick authored
      Summary: add remove<T>, remove(Handler*), removeFront(), removeBack() to Pipeline
      employ these to fix up reusing client pipelines with client dispatchers, which in turn fixes the broken ServiceTest
      
      Reviewed By: @djwatson
      
      Differential Revision: D2152636
      31c71948
    • Nathan Bronson's avatar
      Move AtomicUnorderedInsertMap to folly. · 53e6886f
      Nathan Bronson authored
      Summary: AtomicUnorderedInsertMap is a concurrent hash table that firmly
      at the performance end of the generality <-> performance spectrum.
      If you don't need updates (or can use your own concurrency control when
      overwriting values), you never need to delete, and you can predict your
      capacity perfectly, then you will get wait-free reads, lock-free inserts,
      safe concurrent iteration, and excellent cache and performance outlier
      behavior.  Arbitrary key and value types are supported.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2145281
      53e6886f
    • Woo Xie's avatar
      do not suppurt compress and expand · fe6e73a6
      Woo Xie authored
      Summary: the openssl improvement does not support compression and decompression.
      
      Reviewed By: @Invalid auth token., @afrind
      
      Differential Revision: D2151003
      fe6e73a6
    • Sara Golemon's avatar
      Revert "Using emplace_back to avoid temporary" · 8ce13dcc
      Sara Golemon authored
      Summary: This reverts commit 0968dcc2f0e02998fa53007853e0c0aad0a423b7.
      
      Reverts D2151582
      
      Reviewed By: @​iainb
      
      Differential Revision: D2153840
      8ce13dcc
    • Sarang Masti's avatar
      Check readCallback before calling handleRead · cbed8954
      Sarang Masti authored
      Summary: Since readCallback_ could be uninstalled in any of callbacks,
      we need to ensure that readCallback_ != nullptr before calling
      handleRead.
      
      Reviewed By: @djwatson
      
      Differential Revision: D2140054
      cbed8954
    • Tudor Bosman's avatar
      ExceptionWrapper: use std::decay in implicit constructor · bf87ffac
      Tudor Bosman authored
      Summary: Because Ex resolves to SomeException&, and then all the tests in optimize<>
      fail.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2152893
      bf87ffac
    • Sara Golemon's avatar
      Merge pull request #225 from wb14123/dup · ae93c76d
      Sara Golemon authored
      Remove duplicate header file
      Somehow this was already correct in the internal repo, but not the external one.
      Thanks!
      ae93c76d