1. 19 Jun, 2015 4 commits
  2. 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
  3. 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
  4. 15 Jun, 2015 8 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
    • Bin Wang's avatar
      Remove duplicate header file · bf1d0eed
      Bin Wang authored
      bf1d0eed
  5. 12 Jun, 2015 10 commits
    • Praveen Kumar's avatar
      Using emplace_back to avoid temporary · e9e3d9b6
      Praveen Kumar authored
      Summary: Directly pass the arguments to respective constructors.
      Instead of first making temporary and then pass that.
      
      Closes #218
      
      Reviewed By: @JoelMarcey
      
      Differential Revision: D2151582
      
      Pulled By: @sgolemon
      e9e3d9b6
    • Praveen Kumar's avatar
      Get *=default*ed default constructors · 0efcd8c8
      Praveen Kumar authored
      Summary: Defaulted (*=default*ed) default constructors are better
      because they can be constexpr and/or noexcept when C++ Standard
      thinks it is right to do so. And they remain user-declared rather
      than user-provided. Regarding *=default*ed default constructor,
      benifit is that the work might be done during compilation and we
      might not need to worry about exception paths. And for destructors,
      apart from that that =defaulted definition is in sync with defaulted
      default constructor we might discover that in some cases "() {}" might
      be ill-formed when "= default;" compiltion indicates so. If =defaulted
      definition for destructor doesn't do any harm then why not go for it.
      
      Closes #216
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2145322
      
      Pulled By: @sgolemon
      0efcd8c8
    • Praveen Kumar's avatar
      Needless temporary gone · af7afa42
      Praveen Kumar authored
      Summary: We might be doing:
      1) Create a temporary
      2) Copy/Move out of it
      3) Destroy that temporary.
      Which isn't needed in many places.
      And copy/move elision doesn't work for a temporary
      bound to a reference.
      
      We can forward arguments, directly.
      To get the work done three constructors were added.
      
      Closes #222
      
      Reviewed By: @JoelMarcey, @yfeldblum
      
      Differential Revision: D2151731
      
      Pulled By: @sgolemon
      af7afa42
    • Misha Shneerson's avatar
      Added fiber supported mutex to folly · 143b92ee
      Misha Shneerson authored
      Summary: To be able to use fiber lock in thrift
      
      Reviewed By: @brianwatling, @yfeldblum
      
      Differential Revision: D2149936
      143b92ee
    • Yablonskyy@axilera.com's avatar
      Add EOS checking to 'parseLeadingNumber' function. · 01c150d5
      Yablonskyy@axilera.com authored
      Summary: parseLeadingNumber does not contain EOS validation and raise an exception when '/sys/devices/system/cpu/cpu0/index0/shared_cpu_list' contains only one number like '0'.
      Closes #207
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2148015
      
      Pulled By: @sgolemon
      01c150d5
    • Hans Fugal's avatar
      apple-gate ThreadLocal in fibers code · 2bf6f465
      Hans Fugal authored
      Summary: Some internal malloc shims broke on using folly::ThreadLocal, so only do that for `__APPLE__`.
      
      Reviewed By: @brianwatling
      
      Differential Revision: D2151318
      2bf6f465
    • Nicholas Ormrod's avatar
      Suppress clang memcpy warnings · 3bb12827
      Nicholas Ormrod authored
      Summary: Clang warns when types with vtables are memcpy'd. If the type
      has declared itself to be relocatable, then this is the desired
      behavior. If the type has not declared itself to be relocatable, then
      the memcpy codepath is dead. However, the dead codepath is still
      instantiated (it's inside an if block with a static check, but c++
      doesn't have static-if), so the compiler spits out a nasty warning
      anyways.
      
      Each memcpy reference inside of fbvector has been void-ified. I have
      looked at all the codepaths leading to the memcpys, and see that they
      have isRelocatable or isTriviallyCopyable checks.
      
      Reviewed By: @markisaa
      
      Differential Revision: D2148286
      3bb12827
    • Alan Frindell's avatar
      Temporarily disable performWriteIovec · 193eb597
      Alan Frindell authored
      Summary: As in title
      
      Reviewed By: @djwatson
      
      Differential Revision: D2151092
      193eb597
    • Nicholas Ormrod's avatar
      Recycle heap on assignment · 461f0182
      Nicholas Ormrod authored
      Summary: For standard containers, assignment tries to reuse heap space.
      Dynamic assignment does not - it calls destroy(), and then reconstructs
      a new dynamic. In the case that the old and new types are the same (eg
      assigning a dynamic-vector to a dynamic-vector) we can call through to
      the underlying type's assignment operator.
      
      Reviewed By: @jdelong
      
      Differential Revision: D2148093
      461f0182
    • Woo Xie's avatar
      opt proxygen with new SSL_write_iovec function · 9f41a73a
      Woo Xie authored
      Summary: this taks advantage of the SSL_write_iovec function to improve CPU.  According our testing, it saves 10+% CPU.
      
      Reviewed By: @djwatson
      
      Differential Revision: D2119223
      9f41a73a
  6. 11 Jun, 2015 12 commits