22 #include <unordered_map> 28 using namespace folly;
40 cout <<
"allocate " << n <<
" values, " << n *
sizeof(
T) <<
" bytes\n";
41 return std::allocator<T>{}.allocate(n);
45 cout <<
"deallocate " << n <<
" values, " << n *
sizeof(
T) <<
" bytes\n";
46 std::allocator<T>{}.deallocate(ptr, n);
82 template <
typename K,
typename V,
template <
typename>
class A>
88 A<std::pair<K const, V>>>;
90 template <
typename K,
typename V,
template <
typename>
class A>
94 template <
typename K,
typename V,
template <
typename>
class A>
98 template <
typename K,
typename V,
template <
typename>
class A>
104 A<std::pair<K const, V>>>;
106 template <
typename M>
108 cout <<
"----------------------\n";
109 cout << name <<
"\n";
110 cout <<
"SIZE = " <<
sizeof(
M) <<
"\n";
111 cout <<
"CONSTRUCTING\n";
114 cout <<
"INSERTING 1 VALUE\n";
115 typename M::key_type
k{};
117 cout <<
"DESTROYING\n";
122 template <
template <
typename,
typename,
template <
typename>
class>
class T>
124 runSingleInsert<T<uint64_t, array<char, 8>,
LoggingAlloc>>(
125 name +
" uint64_t 8");
126 runSingleInsert<T<string, array<char, 8>,
LoggingAlloc>>(
name +
" string 8");
127 runSingleInsert<T<uint64_t, array<char, 128>,
LoggingAlloc>>(
128 name +
" uint64_t 128");
129 runSingleInsert<T<string, array<char, 128>,
LoggingAlloc>>(
130 name +
" string 128");
134 std::unordered_map<int16_t, float>&
m,
137 return i != m.end() ? 1 : 0;
144 return i != m.end() ? 1 : 0;
151 return i != m.end() ? 1 : 0;
158 return i != m.end() ? 1 : 0;
162 std::unordered_map<int16_t, uint32_t>&
m,
190 std::unordered_map<int16_t, uint32_t>&
m,
191 std::unordered_map<int16_t, uint32_t>::iterator iter) {
229 runSingleInserts<StdUnorderedMapTable>(
"std");
230 runSingleInserts<F14ValueMapTable>(
"f14value");
231 runSingleInserts<F14NodeMapTable>(
"f14node");
232 runSingleInserts<F14VectorMapTable>(
"f14vector");
FOLLY_NOINLINE int codeSize_find_Std(std::unordered_map< int16_t, float > &m, int16_t k)
FOLLY_NOINLINE void codeSize_bracket_F14Node(F14NodeMap< int16_t, uint32_t > &m, int16_t k, uint32_t v)
T * allocate(std::size_t n)
std::unordered_map< K, V, std::hash< K >, std::equal_to< K >, A< std::pair< K const, V >>> StdUnorderedMapTable
void deallocate(T *ptr, std::size_t n)
T const * address(T const &v) const
—— Concurrent Priority Queue Implementation ——
FOLLY_NOINLINE int codeSize_find_F14Node(F14NodeMap< int16_t, float > &m, int16_t k)
FOLLY_NOINLINE void codeSize_erase_F14Value(F14ValueMap< int16_t, uint32_t > &m, F14ValueMap< int16_t, uint32_t >::iterator iter)
bool operator==(LoggingAlloc< T > const &) const
std::size_t max_size() const
FOLLY_NOINLINE void codeSize_erase_F14Node(F14NodeMap< int16_t, uint32_t > &m, F14NodeMap< int16_t, uint32_t >::iterator iter)
static map< string, int > m
std::ptrdiff_t difference_type
FOLLY_NOINLINE int codeSize_find_F14Value(F14ValueMap< int16_t, float > &m, int16_t k)
FOLLY_NOINLINE void codeSize_bracket_F14Vector(F14VectorMap< int16_t, uint32_t > &m, int16_t k, uint32_t v)
FOLLY_NOINLINE void codeSize_erase_Std(std::unordered_map< int16_t, uint32_t > &m, std::unordered_map< int16_t, uint32_t >::iterator iter)
**Optimized Holders **The template hazptr_array< M > provides most of the functionality *of M hazptr_holder s but with faster construction destruction *for M
FOLLY_NOINLINE void codeSize_erase_F14Vector(F14VectorMap< int16_t, uint32_t > &m, F14VectorMap< int16_t, uint32_t >::iterator iter)
FOLLY_NOINLINE void codeSize_bracket_Std(std::unordered_map< int16_t, uint32_t > &m, int16_t k, uint32_t v)
void runSingleInsert(std::string const &name)
bool operator!=(LoggingAlloc< T > const &) const
FOLLY_NOINLINE int codeSize_find_F14Vector(F14VectorMap< int16_t, float > &m, int16_t k)
FOLLY_NOINLINE void codeSize_bracket_F14Value(F14ValueMap< int16_t, uint32_t > &m, int16_t k, uint32_t v)
T const & const_reference
void runSingleInserts(std::string const &name)