1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

fix(perf,allocator): test build with reduced CountingAllocator parameter values.

This commit is contained in:
drrtuy
2025-04-29 17:54:36 +00:00
parent 252b3ddbef
commit 01cc73d416
8 changed files with 51 additions and 41 deletions

View File

@ -63,13 +63,13 @@ void PoolAllocator::newBlock()
{
if (alloc)
{
std::cout << "PoolAllocator new block with counting alloc" << std::endl;
// std::cout << "PoolAllocator new block with counting alloc" << std::endl;
mem.emplace_back(boost::allocate_shared<PoolAllocatorBufType>(*alloc, allocSize));
}
else
{
std::cout << "PoolAllocator new block w/o counting alloc" << std::endl;
// std::cout << "PoolAllocator new block w/o counting alloc" << std::endl;
mem.emplace_back(boost::make_shared<PoolAllocatorBufType>(allocSize));
}
nextAlloc = mem.back().get();
@ -81,17 +81,17 @@ void PoolAllocator::newBlock()
void* PoolAllocator::allocOOB(uint64_t size)
{
OOBMemInfo memInfo;
std::cout << "PoolAllocator allocOOB" << std::endl;
// std::cout << "PoolAllocator allocOOB" << std::endl;
memUsage += size;
if (alloc)
{
std::cout << "PoolAllocator allocOOB with counting alloc" << std::endl;
// std::cout << "PoolAllocator allocOOB with counting alloc" << std::endl;
memInfo.mem = boost::allocate_shared<PoolAllocatorBufType>(*alloc, size);
}
else
{
std::cout << "PoolAllocator allocOOB w/o counting alloc" << std::endl;
// std::cout << "PoolAllocator allocOOB w/o counting alloc" << std::endl;
memInfo.mem = boost::make_shared<PoolAllocatorBufType>(size);
}
memInfo.size = size;

View File

@ -101,13 +101,13 @@ STLPoolAllocator<T>::STLPoolAllocator(joblist::ResourceManager* rm)
{
if (rm)
{
std::cout << "STLPoolAllocator with RM " << std::endl;
auto alloc = rm->getAllocator<PoolAllocatorBufType>();
// std::cout << "STLPoolAllocator with RM " << std::endl;
auto alloc = rm->getAllocator<PoolAllocatorBufType>(1024);
pa.reset(new PoolAllocator(alloc, DEFAULT_SIZE));
}
else
{
std::cout << "STLPoolAllocator w/o RM " << std::endl;
// std::cout << "STLPoolAllocator w/o RM " << std::endl;
pa.reset(new PoolAllocator(DEFAULT_SIZE));
}
}

View File

@ -45,8 +45,10 @@ std::unique_ptr<HashTable> makeHashMap(size_t bucketCount, ResourceManager* reso
{
// auto alloc = resourceManager->getAllocator<T>();
// return std::unique_ptr<T>(new T(bucketCount, TupleJoiner::hasher(), typename T::key_equal(), alloc));
// std::cout << " makeHashMap " << std::endl;
return std::unique_ptr<HashTable>(new HashTable(bucketCount, TupleJoiner::hasher(),
typename HashTable::key_equal(),
// resourceManager->getAllocator<typename HashTable::value_type>()));
utils::STLPoolAllocator<typename HashTable::value_type>(resourceManager)));
}

View File

@ -497,6 +497,9 @@ class TupleJoiner
template<typename K, typename V>
using HashMapTemplate = std::unordered_multimap<K, V, hasher, std::equal_to<K>,
utils::STLPoolAllocator<std::pair<const K, V>>>;
// template<typename K, typename V>
// using HashMapTemplate = std::unordered_multimap<K, V, hasher, std::equal_to<K>,
// allocators::CountingAllocator<std::pair<const K, V>>>;
using hash_t = HashMapTemplate<int64_t, uint8_t*>;
using sthash_t = HashMapTemplate<int64_t, rowgroup::Row::Pointer>;
using typelesshash_t = HashMapTemplate<TypelessData, rowgroup::Row::Pointer>;

View File

@ -776,11 +776,12 @@ void IdbOrderBy::initialize(const RowGroup& rg)
// These two blocks contain structs with memory accounting.
fOrderByQueue.reset(new SortingPQ(rowgroup::rgCommonSize, fRm->getAllocator<OrderByRow>()));
if (fDistinct)
{
fDistinctMap.reset(new DistinctMap_t(10, Hasher(this, getKeyLength()), Eq(this, getKeyLength()),
utils::STLPoolAllocator<rowgroup::Row::Pointer>(fRm)));
}
// WIP
// if (fDistinct)
// {
// fDistinctMap.reset(new DistinctMap_t(10, Hasher(this, getKeyLength()), Eq(this, getKeyLength()),
// utils::STLPoolAllocator<rowgroup::Row::Pointer>(fRm)));
// }
}
bool IdbOrderBy::getData(RGData& data)