This document describes the rational and benefits of Value benchmarks.
###Real world Example:
Libc++ has been offered a new implementation of std::sort that is supposed to be faster.
Determine which implementation is better.
| diff --git a/include/experimental/algorithm b/include/experimental/algorithm | |
| new file mode 100644 | |
| index 0000000..a2e956f | |
| --- /dev/null | |
| +++ b/include/experimental/algorithm | |
| @@ -0,0 +1,114 @@ | |
| +// -*- C++ -*- | |
| +//===-------------------------- algorithm ---------------------------------===// | |
| +// | |
| +// The LLVM Compiler Infrastructure |
| These two commits clean up undefined behavior in readEncodedPointer. | |
| - r231839: Fix PR21580 - Undefined behavior in readEncodedPointer() | |
| https://llvm.org/bugs/show_bug.cgi?id=21580 | |
| https://github.com/llvm-mirror/libcxxabi/commit/89ea9ad0b0a48a9b9fccf6de81bdca1861960855 | |
| - r231852: Remove unneeded const_cast in readPointerHelper. Pointed out by jroelofs | |
| https://github.com/llvm-mirror/libcxxabi/commit/fdd39fd838828bba84c4f7ad620207ae0d734ad5 | |
| diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py | |
| index 55916f0..4342a79 100644 | |
| --- a/test/libcxx/test/config.py | |
| +++ b/test/libcxx/test/config.py | |
| @@ -269,8 +269,8 @@ class Configuration(object): | |
| # Configure include paths | |
| self.compile_flags += ['-nostdinc++'] | |
| support_path = os.path.join(self.src_root, 'test/support') | |
| - self.cxx.compile_flags += ['-I' + support_path] | |
| - self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')] |
| template <class Tp> | |
| struct PrintType; | |
| typedef void MyFunc(); | |
| int main() { | |
| PrintType<MyFunc const> p; | |
| } |
| #include <type_traits> | |
| #include <tuple> | |
| #include <cassert> | |
| template <bool Pred, class Then = bool> | |
| using EnableIf = typename std::enable_if<Pred, Then>::type; | |
| template <bool Pred> | |
| using BoolT = std::integral_constant<bool, Pred>; | |
| import ast | |
| import decimal | |
| class FeatureTransformer(ast.NodeTransformer): | |
| ALLOWED_NAMES = set(['True', 'False', 'None']) | |
| ALLOWED_NODE_TYPES = set([ | |
| 'Num', # allow numbers too | |
| 'Name', # an identifier... | |
| 'Load', # loads a value of a variable with given identifier |
<__functional_base>
unary_function and binary_function detection.__weak_result_type.__invoke definition (C++11 Only)reference_wrapper__is_transparentuses_allocator metaprogramming<__functional_base_03>unary_function and binary_function detection.| diff --git a/include/functional b/include/functional | |
| index 3c9f5a7..539a708 100644 | |
| --- a/include/functional | |
| +++ b/include/functional | |
| @@ -1475,13 +1475,25 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT | |
| } // __function | |
| +typedef typename aligned_storage<3*sizeof(void*)>::type _SmallFuncBuf; | |
| + |
| #include "benchmark/benchmark.h" | |
| #include <cstdint> | |
| #include <limits> | |
| using namespace benchmark; | |
| typedef std::uint32_t UInt32; | |
| typedef std::uint64_t UInt64; | |
| template <class IntType> |