Permalink
Commits on Sep 17, 2012
  1. folly/SmallLocks.h compiler warning

    Summary: Couldn't get an HPHP extension to compile against this
    
    Test Plan: compiled HPHP including folly/dynamic.h
    
    Reviewed By: delong.j@fb.com
    
    FB internal diff: D574364
    alikhtarov committed with jdelong Sep 14, 2012
  2. Verbosify exception tracer dumps

    Test Plan: by hand
    
    Reviewed By: philipp@fb.com
    
    FB internal diff: D570233
    tudor committed with jdelong Sep 10, 2012
  3. support -nan in conversion

    Summary:
    Folly supports -inf and nan but not -nan, instead it raised unexpected exceptions not handled in the upstream.
    
    This diff is separated out from D569816 -- Diff1.
    
    Test Plan: std::isnan(folly::to<double>(-nan))
    
    Reviewed By: tudorb@fb.com
    
    FB internal diff: D569939
    Fan Guo committed with jdelong Sep 10, 2012
  4. Fix InpuByteStreamSplitter in debug mode.

    Test Plan: stream_test, exception_tracer_test
    
    Reviewed By: soren@fb.com
    
    FB internal diff: D569476
    tudor committed with jdelong Sep 8, 2012
  5. Histogram function to write tab-separated values.

    Summary: Export histograms in a tab-separated format.
    
    Test Plan: Used it.
    
    Reviewed By: lucian@fb.com
    philippv committed with jdelong Sep 1, 2012
  6. Minor huge pages library changes

    Summary:
    Moved to separate library instead of :io
    Got rid of the mode argument when creating files -- umask is your friend
    Separated getSize interface from create
    Added FsUtil.h for some fs::path operations
    Switched some interfaces to fs::path instead of string / StringPiece
    Canonicalize paths so we don't care whether paths are absolute or
    relative
    
    Test Plan: fs_util_test, by hand
    
    Reviewed By: philipp@fb.com
    
    FB internal diff: D564465
    tudor committed with jdelong Sep 1, 2012
  7. Huge page library.

    Test Plan: by hand
    
    Reviewed By: lucian@fb.com
    
    FB internal diff: D555164
    tudor committed with jdelong Aug 22, 2012
  8. fix build on: define own version of ALLOCM_LG_ALIGN

    Summary:
    On --platform=gcc-4.6.2-glibc-2.13-fb the build would fail because
    
    fbcode/third-party/gcc-4.6.2-glibc-2.13-fb/libgcc/libgcc-4.6.2/b4e37bb/include/c++/4.6.2/bits/basic_fbstring_malloc.h
    
    defines it's own version of ALLOCM_SUCCESS & co., but not ALLOCM_LG_ALIGN :(
    
    The '#ifdef ALLOCM_SUCCESS' check in 'folly/Malloc.h' would pass even
    though we didn't include jemalloc.
    
    Test Plan: build it
    
    Reviewed By: philipp@fb.com
    
    FB internal diff: D562273
    luciang committed with jdelong Aug 30, 2012
  9. Unbreak build.

    Summary: I'll pretend you reviewed this.
    
    Test Plan: build
    
    Reviewed By: simpkins@fb.com
    
    FB internal diff: D562255
    tudor committed with jdelong Aug 30, 2012
  10. Move exception tracer library to folly/experimental

    Summary:
    This change is mostly mechanical (moving files, changing include paths,
    etc).  I made some changes to TARGETS to make it easier for the library
    to be linked in (instead of LD_PRELOADed)
    
    Test Plan: by hand
    
    Reviewed By: simpkins@fb.com
    
    FB internal diff: D562196
    tudor committed with jdelong Aug 30, 2012
  11. Add ALLOCM_LG_ALIGN to Malloc.h

    Test Plan: .
    
    Reviewed By: soren@fb.com
    luciang committed with jdelong Aug 29, 2012
  12. Stream operations: file access, iteration, splitting.

    Summary: Intended to complement and replace strings::byLine.
    
    Test Plan: stream_test
    
    Reviewed By: delong.j@fb.com
    
    FB internal diff: D463341
    tudor committed with jdelong May 2, 2012
Commits on Aug 26, 2012
  1. Fix fedora / ubuntu build

    Test Plan: yes
    
    Reviewed By: andrewjcg@fb.com
    
    FB internal diff: D558628
    tudor committed Aug 26, 2012
  2. folly: simplify the stats avgHelper() function

    Summary:
    When the input type is a long double, perform division using long
    double.  In all other cases, divide using double precision.
    
    Also fix the EXPECT_EQ() usage in the test case.
    
    Test Plan: fbconfig -r common/stats folly && fbmake runtests
    
    Reviewed By: andrei.alexandrescu@fb.com
    
    FB internal diff: D555433
    simpkins committed with tudor Aug 22, 2012
  3. BucketedTimeSeries: fix type converison issues computing avg()

    Summary:
    D527040 had a bug in the code to compute the average: it incorrectly
    performed unsigned division when ValueType was a signed integer type.
    As a result, the average was reported incorrectly for stats with
    negative values.
    
    This makes the average code more intelligent when handling type
    conversions: if the caller wants a floating point value, or if the input
    type is floating point, floating point division is always returned.
    Otherwise, if the input is a signed type, signed integer division is
    performed.  Otherwise, unsigned integer division is performed.
    
    Test Plan: beholdunittests
    
    Reviewed By: lars@fb.com
    
    FB internal diff: D553583
    simpkins committed with tudor Aug 20, 2012
  4. folly: add a simple benchmark for Histogram::addValue()

    Summary:
    I wrote this an an example for the BENCHMARK_NAMED_PARAM() comments in
    D527040, and figured I might as well check it in as a real benchmark.
    
    Test Plan:
    Here's the output:
    
    ======================================================================
    folly/test/HistogramBenchmark.cpp         relative  time/iter  iters/s
    ======================================================================
    addValue(0_to_100)                                    15.43ns   64.81M
    addValue(0_to_1000)                                   15.45ns   64.70M
    addValue(5k_to_20k)                                   15.46ns   64.67M
    ======================================================================
    
    Reviewed By: rajat@fb.com
    
    FB internal diff: D552875
    simpkins committed with tudor Aug 19, 2012
  5. change shared_ptr<>* to raw pointer

    Summary:
    change shared_ptr<>* to raw pointer in
    forwardIndex in RTIndex. This saves 16 bytes per
    forward list (decrease from 88 to 72) and translates
    to about 4-5% memory saving for RTIndex in ff tier.
    
    Test Plan: unit test
    
    Reviewed By: xliux@fb.com
    
    FB internal diff: D551191
    sding committed with tudor Aug 16, 2012
  6. Add BucketedTimeSeries to folly

    Summary:
    Add the BucketedTimeSeries class to folly.  This tracks time series
    counter data, using a circular buffer of buckets to expire old data
    points as time progresses.
    
    It supports querying the overall sum, count, average, and rate for the
    duration of the time series, as well as estimating these values for
    portions of the overall duration.
    
    Test Plan: Unit tests included.
    
    Reviewed By: andrei.alexandrescu@fb.com
    
    FB internal diff: D527040
    simpkins committed with tudor Jul 22, 2012
  7. one more simple folly::join optimization

    Summary:
    Before:
    
    _bin/folly/test/string_test --benchmark --bm_regex=join --bm_min_usec=1000000
    ============================================================================
    folly/test/StringTest.cpp                       relative  time/iter  iters/s
    ============================================================================
    joinCharStr                                                  3.59us  278.29K
    joinStrStr                                                   4.44us  225.09K
    joinInt                                                     10.55us   94.76K
    ============================================================================
    
    And after:
    
    _bin/folly/test/string_test --benchmark --bm_regex=join --bm_min_usec=1000000
    ============================================================================
    folly/test/StringTest.cpp                       relative  time/iter  iters/s
    ============================================================================
    joinCharStr                                                  3.61us  277.01K
    joinStrStr                                                   3.77us  264.97K
    joinInt                                                      9.92us  100.81K
    ============================================================================
    
    Test Plan: unittests, benchmark
    
    Reviewed By: tudorb@fb.com
    
    FB internal diff: D552364
    philippv committed with tudor Aug 17, 2012
  8. Add Bob Jenkins's SpookyHash to folly.

    Summary:
    http://burtleburtle.net/bob/hash/spooky.html
    The code is in the public domain, so republishing it as such is fine.
    The code needed modifications (the test was designed to run on Windows
    only; removed unhygienic typedefs; moved to folly::hash namespace)
    
    Also updated Makefile.am files.
    
    Test Plan: test added
    
    Reviewed By: soren@fb.com
    
    FB internal diff: D549572
    tudor committed Aug 15, 2012
  9. isPowTwo

    Summary:
    a la Hacker's Delight.
    
    Also, fix nonsensical nextPowTwo benchmark.
    
    Test Plan: Added test and benchmark.
    
    Reviewed By: tudorb@fb.com
    
    FB internal diff: D551510
    Michael Curtiss committed with tudor Aug 17, 2012
  10. one more folly::join overload

    Summary: To allow codemod changes.
    
    Test Plan: ran test
    
    Reviewed By: tudorb@fb.com
    
    FB internal diff: D549516
    philippv committed with tudor Aug 15, 2012
  11. Task #906853: Implement ThreadLocalServiceData and reduce lock conten…

    …tions during channel counter update
    
    Summary:
    Cache the counter updates on thread local data structures and aggregate/publish
    the data from a separate thread periodically. The ThreadLocalServiceData is
    implemented on top of the TLStats data structures.
    
    I am plannig to deploy a private build to production tomorrow to test this
    change in production, but figured it might be better to send the diff out first
    and get code review feedbacks at the same time.
    
    Test Plan: Run and pass unit tests. Run end-to-end testings on sandbox. (TBD)
    Deploy a private build to a production server and make sure the thrift call
    latency is reduced.
    
    Reviewed By: xin@fb.com
    
    FB internal diff: D540239
    Lee Hwa committed with tudor Aug 6, 2012
  12. folly: randomNumberSeed should be random wrt multiple threads

    Summary:
    Right now, it relies on process id rather than on thread id. Thus, it can
    return the same seed when called from multiple threads over really short
    period of time, and these unlucky threads will end up with identical "random"
    sequences.
    
    Test Plan: newly added test fails against trunk, passes against changes in the diff
    
    Reviewed By: tudorb@fb.com
    
    FB internal diff: D548129
    dorserg committed with tudor Aug 14, 2012
  13. strings join

    Summary: The same interface as ##facebook::strings::join##, but few times faster.
    
    Test Plan: folly/test/StringTest.cpp
    
    Reviewed By: tudorb@fb.com
    
    FB internal diff: D548863
    philippv committed with tudor Aug 15, 2012
  14. Added dynamic::convertTo<Type> method

    Summary: convert a dynamic to a well-typed object
    
    Test Plan: run test file
    
    Reviewed By: delong.j@fb.com
    
    FB internal diff: D517021
    Gownta committed with tudor Aug 14, 2012
  15. Add exception_tracer

    Summary: script to wrap gateway to run it with exception tracer.
    
    Test Plan: deploy
    
    Reviewed By: rajat@fb.com
    
    FB internal diff: D548147
    nitay committed with tudor Aug 14, 2012
  16. folly: print nice time suffixes in benchmark output

    Summary: Print the times using "ms" for milliseconds, "us" for microseconds, etc.
    
    Test Plan:
    $ ./_bin/folly/test/benchmark_test
    ======================================================================
    folly/test/BenchmarkTest.cpp              relative  time/iter  iters/s
    ======================================================================
    bmFun                                                  3.36ns  298.01M
    bmRepeatedFun                                          1.76ns  569.38M
    ----------------------------------------------------------------------
    gun                                                    1.70ns  589.82M
    ----------------------------------------------------------------------
    baselinevector                                         3.08us  324.87K
    bmVector                                    13.64%    22.56us   44.32K
    ----------------------------------------------------------------------
    superslow                                               1.00s  999.82m
    ======================================================================
    
    Reviewed By: andrei.alexandrescu@fb.com
    
    FB internal diff: D546209
    simpkins committed with tudor Aug 11, 2012
  17. Fix debug build.

    Summary: Only tested in release mode, sigh. Fixed a failing asserd.
    
    Test Plan: tested in dbg mode
    
    Reviewed By: tudorb@fb.com
    
    FB internal diff: D546318
    Andrei Alexandrescu committed with tudor Aug 11, 2012
  18. Faster repeated append (particularly for short strings)

    Summary:
    https://phabricator.fb.com/D544159 reveals a large performance gap between
    fbstring and std::string for repeated appends of short strings, which I
    consider a relatively urgent matter (as much of our code uses such patterns).
    
    This diff attempts to fix the issue in a principled manner by first appending
    the first character with exponential reallocation, after which the rest of the
    characters are appended normally.
    
    With the proposed fix the benchmarks are much faster than the previous fbstring
    and also than std::string (numbers to follow in comments).
    
    Test Plan: unittested and benchmarked
    
    Reviewed By: soren@fb.com
    
    FB internal diff: D545416
    Andrei Alexandrescu committed with tudor Aug 10, 2012
  19. sizeof works just as well as numeric_limits<T>::digits

    Summary: ... and is shorter and more readable
    
    Test Plan: folly/test
    
    Reviewed By: andrei.alexandrescu@fb.com
    
    FB internal diff: D545774
    tudor committed Aug 10, 2012
  20. Increased std::vector compatibility of fbvector

    Summary:
    fbvector was not accepting move_iterators for
    InputIterator-templated construct, assign, and insert. The root cause
    was the check '(b_ <= &*first && &*first < e_)', used to check if the
    assignment was from internal data. This addressof check does not compile
    with rvalue-references, and causes the first iterator to be dereferenced
    more than once; both against the contract of std::vector. The standard
    allows for undefined behaviour in the self-iterator case, so there are
    no contractual barriers to removing this check.
    
    Test Plan:
    run fbvector test and benchmark. An fbgs for 'assign' turns
    up few matches; the seem to be normal use-case. Test fbvector assign
    with self-iterators in order (i.e. fbv.assign(fbv.begin(), fbv.end()));
    this seems to work fine.
    
    Reviewed By: andrei.alexandrescu@fb.com
    
    FB internal diff: D535012
    Gownta committed with tudor Aug 10, 2012
  21. Removing broken specialization of std::hash<std::tuple>

    Summary: ^
    
    Test Plan: Unit tests
    
    Reviewed By: delong.j@fb.com
    
    FB internal diff: D543586
    Tom Jackson committed with tudor Aug 8, 2012
  22. Add "short append" benchmark to fbstring benchmark suite.

    Summary:
    Appending many small strings to fbstring appears much slower (~3x) vs.
    std::string. Adding benchmark case to illustrate.
    
    [If this isn't wanted, I can revert]
    
    Test Plan: This is a benchmark.
    
    Reviewed By: soren@fb.com
    
    FB internal diff: D544159
    Jeremy Lilley committed with tudor Aug 9, 2012
  23. folly::dynamic: comment about std::vector const-iter erase issue

    Test Plan: none
    
    Reviewed By: delong.j@fb.com
    
    FB internal diff: D543196
    andrewjcg committed with tudor Aug 9, 2012