1. 13 Jul, 2012 16 commits
    • Rajat Goel's avatar
      A sample diff thats ports FormatTests to benchmarks · 37f18254
      Rajat Goel authored
      Summary:
      Is there any better solution? Maybe a generic flag in Benchmarks to say
      please don't run benchmarks?
      
      Test Plan: (not in folly)
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D503619
      37f18254
    • Tudor Bosman's avatar
      Unbreak build. · 8508742e
      Tudor Bosman authored
      Summary: I could have sworn I undid that un-templatification of the constructor.
      
      Test Plan: build folly/test
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D518981
      8508742e
    • Tudor Bosman's avatar
      Range<const char*> -> Range<const unsigned char*> implicit conversion · 51ef8c7a
      Tudor Bosman authored
      Summary: As they can both be used to represent ranges of bytes.
      
      Test Plan: test added
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D518666
      51ef8c7a
    • Tudor Bosman's avatar
      (minor changes, part of unrelated diff) · d50251a5
      Tudor Bosman authored
      Test Plan: No
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D515713
      d50251a5
    • Tudor Bosman's avatar
      Make Bits<T> work with T = Unaligned<X> (X is unsigned integral type) · 7488db1c
      Tudor Bosman authored
      Test Plan: all folly tests
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D517118
      7488db1c
    • Andrew Gallagher's avatar
      folly/Malloc.h: use libstdc++-safe exception wrappers · 25189ad9
      Andrew Gallagher authored
      Summary:
      gcc errors out when code that throws is compiled with
      '-fno-exceptions'.  Since we add Malloc.h into our custom libstdc++
      use the exception wrappers from functexcept.h so that they can build
      with third-party projects that use '-fno-exceptions'.
      
      Test Plan:
      Built llvm in the gcc-4.7.1-glibc-2.14.1-fb platform with these
      changes.
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D516577
      25189ad9
    • Philip Pronin's avatar
      fix memory order in AtomicHashMap<>::findInternal() · 5eeb7509
      Philip Pronin authored
      Summary:
      Looks like a typo, it should obviously be std::memory_order_relaxed (all
      necessary synchronization is done on numMapsAllocated_).
      
      Test Plan: compiled it, ran tests
      
      Reviewed By: sahrens@fb.com
      
      FB internal diff: D515322
      5eeb7509
    • Andrew Gallagher's avatar
      folly: fix build on ubuntu and fedora platforms · dcf79b80
      Andrew Gallagher authored
      Summary:
      A boost regex dependency wasn't added to the Makefile.am file.  Also
      the it appears that boost thread lib dependencies had a typo in the
      makefile variable name.
      
      Test Plan: ran builds on ubunutu and fedora VMs
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D514039
      dcf79b80
    • Tudor Bosman's avatar
      (minor changes, part of unrelated diff) · 6dca2b32
      Tudor Bosman authored
      Test Plan: no
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D512868
      6dca2b32
    • Tudor Bosman's avatar
      Add IOBufQueue::prepend, fix bug in IOBuf::prepend. · 53d4209f
      Tudor Bosman authored
      Summary:
      IOBuf::prepend needs to increment length_.
      
      Added IOBufQueue::prepend, which uses the headroom in the first buffer
      instead of growing the queue at the head.
      
      Test Plan: tests added
      
      Reviewed By: simpkins@fb.com
      
      FB internal diff: D513676
      53d4209f
    • Eitan Frachtenberg's avatar
      Improve digits_to() performance · b384b6bc
      Eitan Frachtenberg authored
      Summary:
      This optimization eliminates about 75% of the multiplications and bounds
      checking in the original code by using constant lookup tables to convert
      from decical digit to (shifted) binary number, instead of arithmetic.
      The total cost of the lookup tables is 2KB of static memory, but the
      average throughput gain across the range from 1 to 19 characters is 27%.
      The throughput distributes as follows: (in million iters/sec)
      Bytes   Orig    New     Speedup
      1       101.31  110.12  109%
      2       97.42   110.12  113%
      3       97.42   105.53  108%
      4       79.13   101.31  128%
      5       74.48   97.42   131%
      6       74.48   93.81   126%
      7       70.35   93.81   133%
      8       61.77   79.14   128%
      9       58.9    72.35   123%
      10      58.9    74.48   126%
      11      56.28   74.48   132%
      12      50.22   64.93   129%
      13      48.52   60.3    124%
      14      47.74   61.77   129%
      15      46.88   61.77   132%
      16      42.54   55.06   129%
      17      41.51   51.69   125%
      18      40.97   52.76   129%
      19      39.57   52.76   133%
      
      Test Plan: Passes all unit tests
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D493245
      b384b6bc
    • Tudor Bosman's avatar
      Add multi-bit operations to folly/experimental/Bits.h · 2a4a4178
      Tudor Bosman authored
      Summary: Add ability to set and get N consecutive bits from the bit sequence.
      
      Test Plan: test added
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D511438
      2a4a4178
    • Rafael Sagula's avatar
      adding StringPiece constructor that takes a piece of another StringPiece · e9ee87a6
      Rafael Sagula authored
      Summary:
      adding what seems to be a missing constructor to StringPiece --
      I need to be able to take a piece of another StringPiece. (It's possible
      to do that with all sorts of strings already, except StringPiece...)
      
      Test Plan: na -- tested as part of other (dependent) diffs
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D508545
      e9ee87a6
    • Tudor Bosman's avatar
      Remove unnecessary member variable. · 4138e84a
      Tudor Bosman authored
      Test Plan: No
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D509324
      4138e84a
    • Spencer Ahrens's avatar
      add bm_max/min_iters and bm_regex · 13692fcf
      Spencer Ahrens authored
      Summary: These were handy in the old framework and easy enough to add.
      
      Test Plan:
      ran ThreadCachedIntTest - got better (but not perfect due to
      subtraction of single-threaded baseline from multi-threaded results).
      
      Reviewed By: sherman.ye@fb.com
      
      FB internal diff: D490324
      13692fcf
    • Andrew Gallagher's avatar
      folly: get building with gcc-4.7.1 · 9766ab7c
      Andrew Gallagher authored
      Summary:
      A lot of libstdc++-4.7 headers dropped includes of unistdc.h, so
      we'll probably see more of these.
      
      Test Plan: built folly
      
      Reviewed By: simpkins@fb.com
      
      FB internal diff: D508871
      9766ab7c
  2. 27 Jun, 2012 2 commits
  3. 22 Jun, 2012 4 commits
    • Tudor Bosman's avatar
      Add TypedIOBuf. · 9eaebc0d
      Tudor Bosman authored
      Summary: Simple class to handle IOBuf as an array of objects of fixed size.
      
      Test Plan: test added
      
      Reviewed By: brianp@fb.com
      
      FB internal diff: D497287
      9eaebc0d
    • Mike Curtiss's avatar
      Add sizeGuess() member to ProducerConsumerQueue · fdbbdb8f
      Mike Curtiss authored
      Summary:
      This is part 1 of a change to add hysteretic behavior to a blocking queue based on ProducerConsumerQueue.
      
      Knowing the size is useful for monitoring and possibly for objects that contain a ProducerConsumerQueue.
      
      Test Plan:
      Added tiny test-case.
      
      Tests pass
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D496787
      fdbbdb8f
    • Tudor Bosman's avatar
      Add an allocate() member function on IOBufQueue · 62072424
      Tudor Bosman authored
      Summary: Function is documented in the header.
      
      Reviewed By: soren@fb.com
      
      FB internal diff: D494315
      62072424
    • Sherman Ye's avatar
      Fix a typo in benchmark comments · 8108795d
      Sherman Ye authored
      Summary: As title
      
      Test Plan: Deployed to wormhole_apps.dragon.dev
      
      Reviewed By: asharma@fb.com
      
      FB internal diff: D493253
      8108795d
  4. 14 Jun, 2012 4 commits
    • Tudor Bosman's avatar
      Unbreak Ubuntu build. · 89111953
      Tudor Bosman authored
      Summary: follybenchmark and follyfingerprint need folly to work.
      
      Test Plan: built on ubuntu
      
      Reviewed By: andrewjcg@fb.com
      
      FB internal diff: D494955
      89111953
    • Andrew Gallagher's avatar
      Fix clang narrowing error in GroupVarintTables · 2ec85270
      Andrew Gallagher authored
      Summary:
      The __m128i type is a pair of 64-bit signed ints and the values
      generated in generate_varint_tables.py overflow this range, which
      causes clang to complain.
      
      Test Plan:
      Built and ran unittests.  Also verified that the GroupVarintTable.o
      data section was identical with and w/o this change.
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D494645
      2ec85270
    • Tudor Bosman's avatar
      Clarify split / splitTo comments. · ff884b61
      Tudor Bosman authored
      Test Plan: No
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D494525
      ff884b61
    • Chip Turner's avatar
      Move and refactor code · 6834f1d6
      Chip Turner authored
      Summary:
      
      Moves some string manipulation code like humanify into folly
      
      Moves hash-related functions into folly and removes some old includes
      to clean up some code
      
      Adds generic hashing for tuples, similar to pairs
      
      Updates all of the build breakages from the above
      
      Test Plan: run unit tests
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D490478
      6834f1d6
  5. 13 Jun, 2012 2 commits
  6. 12 Jun, 2012 7 commits
    • Tudor Bosman's avatar
      Fix build and test. · 62bbd01a
      Tudor Bosman authored
      Summary:
      Fix bug in FBStringTest (don't reuse the same file name)
      
      Don't use VLOG, as that requires that glog is compiled with gflags
      support, which it isn't always.
      
      Add other targets and tests, make all tests pass.
      
      Test Plan: tests
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D493018
      62bbd01a
    • Tudor Bosman's avatar
      Fix build and test. · 96600045
      Tudor Bosman authored
      Summary:
      Fix bug in FBStringTest (don't reuse the same file name)
      
      Don't use VLOG, as that requires that glog is compiled with gflags
      support, which it isn't always.
      
      Add other targets and tests, make all tests pass.
      
      Test Plan: tests
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D493018
      96600045
    • Tudor Bosman's avatar
      Move Rabin fingerprinting code to folly. · 987da6d2
      Tudor Bosman authored
      Summary:
      Also generate fingerprint tables every time, so the code doesn't rot.
      
      TODO(tudorb): move benchmark to folly
      TODO(tudorb): Include the program used to generate the polynomials
      (can't build as it requires NTL from http://www.shoup.net/ntl/)
      
      Test Plan: folly/test
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D492455
      987da6d2
    • Tudor Bosman's avatar
      InternalBuf doesn't need capacity · e81459f6
      Tudor Bosman authored
      Summary: as it's always kMaxInternalDataSize.
      
      Test Plan: all tests in folly/experimental/io/test, both opt and dbg
      
      Reviewed By: brianp@fb.com
      
      FB internal diff: D492008
      e81459f6
    • Tudor Bosman's avatar
      Properly align internal buffer in IOBuf. · 9f705afd
      Tudor Bosman authored
      Summary:
      Yes, it's gcc specific, because alignas and max_align_t aren't in gcc
      4.6.2.
      
      Test Plan: iobuf_test, test added
      
      Reviewed By: brianp@fb.com
      
      FB internal diff: D491939
      9f705afd
    • Tudor Bosman's avatar
      Add IOBuf::takeOwnership(unique_ptr<T>&&). · c838e280
      Tudor Bosman authored
      Summary:
      Useful for in-place serialization.  Dangerous, obviously, but anything
      involving IOBuf usually is.
      
      Test Plan: test added
      
      Reviewed By: brianp@fb.com
      
      FB internal diff: D491663
      c838e280
    • Tudor Bosman's avatar
      Typos. · 4d3ede0d
      Tudor Bosman authored
      Test Plan: No
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D491038
      4d3ede0d
  7. 09 Jun, 2012 1 commit
  8. 08 Jun, 2012 2 commits
  9. 07 Jun, 2012 2 commits