- Modified relational operators to be friend inline definitions. This allows compilation checking when instantiating classes, avoids predeclarations and results in less verbose code.

- First to make associative containers' tree implementation configurable.
This commit is contained in:
Ion Gaztañaga committed 2013-12-23 23:34:28 +01:00
1 parent f2947c115e
commit 41c2056ec6
62 files changed
+17386 -834

No files matched your search

+327
View File
@@ -0,0 +1,327 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#pragma warning (disable : 4512)
#pragma warning (disable : 4127)
#pragma warning (disable : 4244)
#pragma warning (disable : 4267)
#endif
#include <boost/container/adaptive_pool.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/allocator.hpp>
#include <boost/container/list.hpp>
#include <memory> //std::allocator
#include <iostream> //std::cout, std::endl
#include <vector> //std::vector
#include <cstddef> //std::size_t
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
namespace bc = boost::container;
typedef std::allocator<int> StdAllocator;
typedef bc::allocator<int, 2> AllocatorPlusV2;
typedef bc::allocator<int, 1> AllocatorPlusV1;
typedef bc::adaptive_pool
< int
, bc::ADP_nodes_per_block
, bc::ADP_max_free_blocks
, bc::ADP_only_alignment
, 1> AdPoolAlignOnlyV1;
typedef bc::adaptive_pool
< int
, bc::ADP_nodes_per_block
, bc::ADP_max_free_blocks
, bc::ADP_only_alignment
, 2> AdPoolAlignOnlyV2;
typedef bc::adaptive_pool
< int
, bc::ADP_nodes_per_block
, bc::ADP_max_free_blocks
, 2
, 1> AdPool2PercentV1;
typedef bc::adaptive_pool
< int
, bc::ADP_nodes_per_block
, bc::ADP_max_free_blocks
, 2
, 2> AdPool2PercentV2;
typedef bc::node_allocator
< int
, bc::NodeAlloc_nodes_per_block
, 1> SimpleSegregatedStorageV1;
typedef bc::node_allocator
< int
, bc::NodeAlloc_nodes_per_block
, 2> SimpleSegregatedStorageV2;
//Explicit instantiation
template class bc::adaptive_pool
< int
, bc::ADP_nodes_per_block
, bc::ADP_max_free_blocks
, bc::ADP_only_alignment
, 2>;
template class bc::node_allocator
< int
, bc::NodeAlloc_nodes_per_block
, 2>;
template<class Allocator> struct get_allocator_name;
template<> struct get_allocator_name<StdAllocator>
{ static const char *get() { return "StdAllocator"; } };
template<> struct get_allocator_name<AllocatorPlusV2>
{ static const char *get() { return "AllocatorPlusV2"; } };
template<> struct get_allocator_name<AllocatorPlusV1>
{ static const char *get() { return "AllocatorPlusV1"; } };
template<> struct get_allocator_name<AdPoolAlignOnlyV1>
{ static const char *get() { return "AdPoolAlignOnlyV1"; } };
template<> struct get_allocator_name<AdPoolAlignOnlyV2>
{ static const char *get() { return "AdPoolAlignOnlyV2"; } };
template<> struct get_allocator_name<AdPool2PercentV1>
{ static const char *get() { return "AdPool2PercentV1"; } };
template<> struct get_allocator_name<AdPool2PercentV2>
{ static const char *get() { return "AdPool2PercentV2"; } };
template<> struct get_allocator_name<SimpleSegregatedStorageV1>
{ static const char *get() { return "SimpleSegregatedStorageV1"; } };
template<> struct get_allocator_name<SimpleSegregatedStorageV2>
{ static const char *get() { return "SimpleSegregatedStorageV2"; } };
class MyInt
{
std::size_t int_;
public:
explicit MyInt(std::size_t i = 0) : int_(i){}
MyInt(const MyInt &other)
: int_(other.int_)
{}
MyInt & operator=(const MyInt &other)
{
int_ = other.int_;
return *this;
}
};
template<class Allocator>
void list_test_template(std::size_t num_iterations, std::size_t num_elements, bool csv_output)
{
typedef typename Allocator::template rebind<MyInt>::other IntAllocator;
nanosecond_type tinsert, terase;
boost_cont_malloc_stats_t insert_stats, erase_stats;
std::size_t insert_inuse, erase_inuse;
const size_t sizeof_node = 2*sizeof(void*)+sizeof(int);
typedef bc::list<MyInt, IntAllocator> list_t;
typedef typename list_t::iterator iterator_t;
{
cpu_timer timer;
timer.resume();
list_t l;
for(std::size_t r = 0; r != num_iterations; ++r){
l.insert(l.end(), num_elements, MyInt(r));
}
timer.stop();
tinsert = timer.elapsed().wall;
insert_inuse = boost_cont_in_use_memory();
insert_stats = boost_cont_malloc_stats();
/*
iterator_t it(l.begin());
iterator_t last(--l.end());
for(std::size_t n_elem = 0, n_max = l.size()/2-1; n_elem != n_max; ++n_elem)
{
l.splice(it++, l, last--);
}
*/
//l.reverse();
//Now preprocess erase ranges
std::vector<iterator_t> ranges_to_erase;
ranges_to_erase.push_back(l.begin());
for(std::size_t r = 0; r != num_iterations; ++r){
iterator_t next_pos(ranges_to_erase[r]);
std::size_t n = num_elements;
while(n--){ ++next_pos; }
ranges_to_erase.push_back(next_pos);
}
//Measure range erasure function
timer.start();
for(std::size_t r = 0; r != num_iterations; ++r){
assert((r+1) < ranges_to_erase.size());
l.erase(ranges_to_erase[r], ranges_to_erase[r+1]);
}
timer.stop();
terase = timer.elapsed().wall;
erase_inuse = boost_cont_in_use_memory();
erase_stats = boost_cont_malloc_stats();
}
if(csv_output){
std::cout << get_allocator_name<Allocator>::get()
<< ";"
<< num_iterations
<< ";"
<< num_elements
<< ";"
<< float(tinsert)/(num_iterations*num_elements)
<< ";"
<< (unsigned int)insert_stats.system_bytes
<< ";"
<< float(insert_stats.system_bytes)/(num_iterations*num_elements*sizeof_node)*100.0-100.0
<< ";"
<< (unsigned int)insert_inuse
<< ";"
<< (float(insert_inuse)/(num_iterations*num_elements*sizeof_node)*100.0)-100.0
<< ";";
std::cout << float(terase)/(num_iterations*num_elements)
<< ";"
<< (unsigned int)erase_stats.system_bytes
<< ";"
<< (unsigned int)erase_inuse
<< std::endl;
}
else{
std::cout << std::endl
<< "Allocator: " << get_allocator_name<Allocator>::get()
<< std::endl
<< " allocation/deallocation(ns): " << float(tinsert)/(num_iterations*num_elements) << '\t' << float(terase)/(num_iterations*num_elements)
<< std::endl
<< " Sys MB(overh.)/Inuse MB(overh.): " << (float)insert_stats.system_bytes/(1024*1024) << "(" << float(insert_stats.system_bytes)/(num_iterations*num_elements*sizeof_node)*100.0-100.0 << "%)"
<< " / "
<< (float)insert_inuse/(1024*1024) << "(" << (float(insert_inuse)/(num_iterations*num_elements*sizeof_node)*100.0)-100.0 << "%)"
<< std::endl
<< " system MB/inuse bytes after: " << (float)erase_stats.system_bytes/(1024*1024) << '\t' << boost_cont_in_use_memory()
<< std::endl << std::endl;
}
//Release node_allocator cache
typedef boost::container::container_detail::shared_node_pool
< (2*sizeof(void*)+sizeof(int))
, AdPoolAlignOnlyV2::nodes_per_block> shared_node_pool_t;
boost::container::container_detail::singleton_default
<shared_node_pool_t>::instance().purge_blocks();
//Release adaptive_pool cache
typedef boost::container::container_detail::shared_adaptive_node_pool
< (2*sizeof(void*)+sizeof(int))
, AdPool2PercentV2::nodes_per_block
, AdPool2PercentV2::max_free_blocks
, AdPool2PercentV2::overhead_percent> shared_adaptive_pool_plus_t;
boost::container::container_detail::singleton_default
<shared_adaptive_pool_plus_t>::instance().deallocate_free_blocks();
//Release adaptive_pool cache
typedef boost::container::container_detail::shared_adaptive_node_pool
< (2*sizeof(void*)+sizeof(int))
, AdPool2PercentV2::nodes_per_block
, AdPool2PercentV2::max_free_blocks
, 0u> shared_adaptive_pool_plus_align_only_t;
boost::container::container_detail::singleton_default
<shared_adaptive_pool_plus_align_only_t>::instance().deallocate_free_blocks();
//Release dlmalloc memory
boost_cont_trim(0);
}
void print_header()
{
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
<< "Insertion time(ns)" << ";"
<< "System bytes" << ";"
<< "System overhead(%)" << ";"
<< "In use bytes" << ";"
<< "In use overhead(%)" << ";"
<< "Erasure time (ns)" << ";"
<< "System bytes after" << ";"
<< "In use bytes after"
<< std::endl;
}
int main(int argc, const char *argv[])
{
#define SINGLE_TEST
#ifndef SINGLE_TEST
#ifdef NDEBUG
std::size_t numrep [] = { 3000, 30000, 300000, 3000000, 6000000, 15000000, 30000000 };
#else
std::size_t numrep [] = { 20, 200, 2000, 20000, 40000, 100000, 200000 };
#endif
std::size_t numele [] = { 10000, 1000, 100, 10, 5, 2, 1 };
#else
#ifdef NDEBUG
std::size_t numrep [] = { 1500000 };
#else
std::size_t numrep [] = { 10000 };
#endif
std::size_t numele [] = { 10 };
#endif
bool csv_output = argc == 2 && (strcmp(argv[1], "--csv-output") == 0);
if(csv_output){/*
print_header();
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<AllocatorPlusV1>(numrep[i], numele[i], csv_output);
}
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<AllocatorPlusV2>(numrep[i], numele[i], csv_output);
}
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<AdPoolAlignOnlyV1>(numrep[i], numele[i], csv_output);
}
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<AdPoolAlignOnlyV2>(numrep[i], numele[i], csv_output);
}
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<AdPool2PercentV1>(numrep[i], numele[i], csv_output);
}
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<AdPool2PercentV2>(numrep[i], numele[i], csv_output);
}
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<SimpleSegregatedStorageV1>(numrep[i], numele[i], csv_output);
}
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
list_test_template<SimpleSegregatedStorageV2>(numrep[i], numele[i], csv_output);
}*/
}
else{
for(std::size_t i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
std::cout << "\n ----------------------------------- \n"
<< " Iterations/Elements: " << numrep[i] << "/" << numele[i]
<< "\n ----------------------------------- \n";
list_test_template<AllocatorPlusV1>(numrep[i], numele[i], csv_output);
list_test_template<AllocatorPlusV2>(numrep[i], numele[i], csv_output);
list_test_template<AdPoolAlignOnlyV1>(numrep[i], numele[i], csv_output);
list_test_template<AdPoolAlignOnlyV2>(numrep[i], numele[i], csv_output);
list_test_template<AdPool2PercentV1>(numrep[i], numele[i], csv_output);
list_test_template<AdPool2PercentV2>(numrep[i], numele[i], csv_output);
list_test_template<SimpleSegregatedStorageV1>(numrep[i], numele[i], csv_output);
list_test_template<SimpleSegregatedStorageV2>(numrep[i], numele[i], csv_output);
}
}
return 0;
}
+181
View File
@@ -0,0 +1,181 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#pragma warning (disable : 4512)
#endif
#include <boost/container/detail/alloc_lib_auto_link.hpp>
#define BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
#include <iostream> //std::cout, std::endl
#include <typeinfo> //typeid
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
template <class POD>
void allocation_timing_test(unsigned int num_iterations, unsigned int num_elements)
{
size_t capacity = 0;
unsigned int numalloc = 0, numexpand = 0;
std::cout
<< " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \n"
<< " Iterations/Elements: " << num_iterations << "/" << num_elements << '\n'
<< " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \n"
<< std::endl;
allocation_type malloc_types[] = { BOOST_CONTAINER_EXPAND_BWD, BOOST_CONTAINER_EXPAND_FWD, BOOST_CONTAINER_ALLOCATE_NEW };
const char * malloc_names[] = { "Backwards expansion", "Forward expansion", "New allocation" };
for(size_t i = 0; i < sizeof(malloc_types)/sizeof(allocation_type); ++i){
numalloc = 0; numexpand = 0;
const allocation_type m_mode = malloc_types[i];
const char *malloc_name = malloc_names[i];
cpu_timer timer;
timer.resume();
for(unsigned int r = 0; r != num_iterations; ++r){
void *first_mem = 0;
if(m_mode != BOOST_CONTAINER_EXPAND_FWD)
first_mem = boost_cont_malloc(sizeof(POD)*num_elements*3/2);
void *addr = boost_cont_malloc(1*sizeof(POD));
if(m_mode == BOOST_CONTAINER_EXPAND_FWD)
first_mem = boost_cont_malloc(sizeof(POD)*num_elements*3/2);
capacity = boost_cont_size(addr)/sizeof(POD);
boost_cont_free(first_mem);
++numalloc;
try{
boost_cont_command_ret_t ret;
for(size_t e = capacity + 1; e < num_elements; ++e){
size_t received_size;
size_t min = (capacity+1)*sizeof(POD);
size_t max = (capacity*3/2)*sizeof(POD);
if(min > max)
max = min;
ret = boost_cont_allocation_command
( m_mode, sizeof(POD)
, min, max, &received_size, addr);
if(!ret.first){
std::cout << "(!ret.first)!" << std::endl;
throw int(0);
}
if(!ret.second){
assert(m_mode == BOOST_CONTAINER_ALLOCATE_NEW);
if(m_mode != BOOST_CONTAINER_ALLOCATE_NEW){
std::cout << "m_mode != BOOST_CONTAINER_ALLOCATE_NEW!" << std::endl;
return;
}
boost_cont_free(addr);
addr = ret.first;
++numalloc;
}
else{
assert(m_mode != BOOST_CONTAINER_ALLOCATE_NEW);
if(m_mode == BOOST_CONTAINER_ALLOCATE_NEW){
std::cout << "m_mode == BOOST_CONTAINER_ALLOCATE_NEW!" << std::endl;
return;
}
++numexpand;
}
capacity = received_size/sizeof(POD);
addr = ret.first;
e = capacity + 1;
}
boost_cont_free(addr);
}
catch(...){
boost_cont_free(addr);
throw;
}
}
assert( boost_cont_allocated_memory() == 0);
if(boost_cont_allocated_memory()!= 0){
std::cout << "Memory leak!" << std::endl;
return;
}
timer.stop();
nanosecond_type nseconds = timer.elapsed().wall;
std::cout << " Malloc type: " << malloc_name
<< std::endl
<< " allocation ns: "
<< float(nseconds)/(num_iterations*num_elements)
<< std::endl
<< " capacity - alloc calls (new/expand): "
<< (unsigned int)capacity << " - "
<< (float(numalloc) + float(numexpand))/num_iterations
<< "(" << float(numalloc)/num_iterations << "/" << float(numexpand)/num_iterations << ")"
<< std::endl << std::endl;
boost_cont_trim(0);
}
}
template<unsigned N>
struct char_holder
{
char ints_[N];
};
template<class POD>
int allocation_loop()
{
std::cout << std::endl
<< "-------------------------------------------\n"
<< "-------------------------------------------\n"
<< " Type(sizeof): " << typeid(POD).name() << " (" << sizeof(POD) << ")\n"
<< "-------------------------------------------\n"
<< "-------------------------------------------\n"
<< std::endl;
#define SINGLE_TEST
#ifndef SINGLE_TEST
#ifdef NDEBUG
unsigned int numrep [] = { /*10000, */100000, 1000000, 10000000 };
#else
unsigned int numrep [] = { /*10000, */10000, 100000, 1000000 };
#endif
unsigned int numele [] = { /*10000, */1000, 100, 10 };
#else
#ifdef NDEBUG
unsigned int numrep [] = { 500000 };
#else
unsigned int numrep [] = { 50000 };
#endif
unsigned int numele [] = { 100 };
#endif
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
allocation_timing_test<POD>(numrep[i], numele[i]);
}
return 0;
}
int main()
{
boost_cont_mallopt( (-3)//M_MMAP_THRESHOLD
, 100*10000000);
//allocation_loop<char_holder<4> >();
//allocation_loop<char_holder<6> >();
allocation_loop<char_holder<8> >();
allocation_loop<char_holder<12> >();
//allocation_loop<char_holder<14> >();
allocation_loop<char_holder<24> >();
return 0;
}
+216
View File
@@ -0,0 +1,216 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#pragma warning (disable : 4512)
#endif
#include <boost/container/allocator.hpp>
#define BOOST_CONTAINER_VECTOR_ALLOC_STATS
#include <boost/container/vector.hpp>
#include <memory> //std::allocator
#include <iostream> //std::cout, std::endl
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
namespace bc = boost::container;
typedef std::allocator<int> StdAllocator;
typedef bc::allocator<int, 2, bc::expand_bwd | bc::expand_fwd> AllocatorPlusV2Mask;
typedef bc::allocator<int, 2, bc::expand_fwd> AllocatorPlusV2;
typedef bc::allocator<int, 1> AllocatorPlusV1;
template<class Allocator> struct get_allocator_name;
template<> struct get_allocator_name<StdAllocator>
{ static const char *get() { return "StdAllocator"; } };
template<> struct get_allocator_name<AllocatorPlusV2Mask>
{ static const char *get() { return "AllocatorPlusV2Mask"; } };
template<> struct get_allocator_name<AllocatorPlusV2>
{ static const char *get() { return "AllocatorPlusV2"; } };
template<> struct get_allocator_name<AllocatorPlusV1>
{ static const char *get() { return "AllocatorPlusV1"; } };
//typedef int MyInt;
class MyInt
{
int int_;
public:
MyInt(int i = 0)
: int_(i)
{}
MyInt(const MyInt &other)
: int_(other.int_)
{}
MyInt & operator=(const MyInt &other)
{
int_ = other.int_;
return *this;
}
~MyInt()
{
int_ = 0;
}
};
namespace boost{
template<>
struct has_trivial_destructor_after_move<MyInt>
{
static const bool value = true;
//static const bool value = false;
};
} //namespace boost{
void print_header()
{
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
<< "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";"
<< "New allocations" << ";" << "Bwd expansions" << std::endl;
}
template<class Allocator>
void vector_test_template(unsigned int num_iterations, unsigned int num_elements, bool csv_output)
{
typedef typename Allocator::template rebind<MyInt>::other IntAllocator;
unsigned int numalloc = 0, numexpand = 0;
cpu_timer timer;
timer.resume();
unsigned int capacity = 0;
for(unsigned int r = 0; r != num_iterations; ++r){
bc::vector<MyInt, IntAllocator> v;
v.reset_alloc_stats();
void *first_mem = 0;
try{
first_mem = boost_cont_malloc(sizeof(MyInt)*num_elements*3/2);
v.push_back(MyInt(0));
boost_cont_free(first_mem);
for(unsigned int e = 0; e != num_elements; ++e){
v.push_back(MyInt(e));
}
numalloc += v.num_alloc;
numexpand += v.num_expand_bwd;
capacity = static_cast<unsigned int>(v.capacity());
}
catch(...){
boost_cont_free(first_mem);
throw;
}
}
assert(boost_cont_allocated_memory() == 0);
timer.stop();
nanosecond_type nseconds = timer.elapsed().wall;
if(csv_output){
std::cout << get_allocator_name<Allocator>::get()
<< ";"
<< num_iterations
<< ";"
<< num_elements
<< ";"
<< capacity
<< ";"
<< float(nseconds)/(num_iterations*num_elements)
<< ";"
<< (float(numalloc) + float(numexpand))/num_iterations
<< ";"
<< float(numalloc)/num_iterations
<< ";"
<< float(numexpand)/num_iterations
<< std::endl;
}
else{
std::cout << std::endl
<< "Allocator: " << get_allocator_name<Allocator>::get()
<< std::endl
<< " push_back ns: "
<< float(nseconds)/(num_iterations*num_elements)
<< std::endl
<< " capacity - alloc calls (new/expand): "
<< (unsigned int)capacity << " - "
<< (float(numalloc) + float(numexpand))/num_iterations
<< "(" << float(numalloc)/num_iterations << "/" << float(numexpand)/num_iterations << ")"
<< std::endl;
std::cout << '\n'
<< " ----------------------------------- "
<< std::endl;
}
boost_cont_trim(0);
}
int main(int argc, const char *argv[])
{
#define SINGLE_TEST
#ifndef SINGLE_TEST
#ifdef NDEBUG
unsigned int numit [] = { 20000, 200000, 2000000, 20000000 };
#else
unsigned int numit [] = { 100, 1000, 10000, 100000 };
#endif
unsigned int numele [] = { 10000, 1000, 100, 10 };
#else
#ifdef NDEBUG
unsigned int numit [] = { 20000 };
#else
unsigned int numit [] = { 100 };
#endif
unsigned int numele [] = { 10000 };
#endif
bool csv_output = argc == 2 && (strcmp(argv[1], "--csv-output") == 0);
if(csv_output){
print_header();
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<StdAllocator>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV1>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV2Mask>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV2>(numit[i], numele[i], csv_output);
}
}
else{
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
std::cout << "\n ----------------------------------- \n"
<< " Iterations/Elements: " << numit[i] << "/" << numele[i]
<< "\n ----------------------------------- \n";
vector_test_template<StdAllocator>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV1>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV2Mask>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV2>(numit[i], numele[i], csv_output);
}
}
return 0;
}
+285
View File
@@ -0,0 +1,285 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#pragma warning (disable : 4512)
#pragma warning (disable : 4267)
#pragma warning (disable : 4244)
#endif
#define BOOST_CONTAINER_VECTOR_ALLOC_STATS
#include <boost/container/allocator.hpp>
#include <vector>
#include <boost/container/vector.hpp>
#include <memory> //std::allocator
#include <iostream> //std::cout, std::endl
#include <cstring> //std::strcmp
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
namespace bc = boost::container;
typedef std::allocator<int> StdAllocator;
typedef bc::allocator<int, 2, bc::expand_bwd | bc::expand_fwd> AllocatorPlusV2Mask;
typedef bc::allocator<int, 2> AllocatorPlusV2;
typedef bc::allocator<int, 1> AllocatorPlusV1;
template<class Allocator> struct get_allocator_name;
template<> struct get_allocator_name<StdAllocator>
{ static const char *get() { return "StdAllocator"; } };
template<> struct get_allocator_name<AllocatorPlusV2Mask>
{ static const char *get() { return "AllocatorPlusV2Mask"; } };
template<> struct get_allocator_name<AllocatorPlusV2>
{ static const char *get() { return "AllocatorPlusV2"; } };
template<> struct get_allocator_name<AllocatorPlusV1>
{ static const char *get() { return "AllocatorPlusV1"; } };
#if defined(BOOST_CONTAINER_VECTOR_ALLOC_STATS)
//
// stats_traits;
//
template<template<class, class> class Vector>
struct stats_traits;
template<>
struct stats_traits<std::vector>
{
template<class T, class A>
static void reset_alloc_stats(std::vector<T, A> &)
{}
template<class T, class A>
static std::size_t get_num_alloc(std::vector<T, A> &)
{ return 0; }
template<class T, class A>
static std::size_t get_num_expand(std::vector<T, A> &)
{ return 0; }
};
template<>
struct stats_traits<bc::vector>
{
template<class T, class A>
static void reset_alloc_stats(bc::vector<T, A> &v)
{ v.reset_alloc_stats(); }
template<class T, class A>
static std::size_t get_num_alloc(bc::vector<T, A> &v)
{ return v.num_alloc; }
template<class T, class A>
static std::size_t get_num_expand(bc::vector<T, A> &v)
{ return v.num_expand_fwd; }
};
#endif //BOOST_CONTAINER_VECTOR_ALLOC_STATS
template<template<class, class> class Vector> struct get_container_name;
template<> struct get_container_name<std::vector>
{ static const char *get() { return "StdVector"; } };
template<> struct get_container_name<bc::vector>
{ static const char *get() { return "BoostContainerVector"; } };
class MyInt
{
int int_;
public:
explicit MyInt(int i = 0)
: int_(i)
{}
MyInt(const MyInt &other)
: int_(other.int_)
{}
MyInt & operator=(const MyInt &other)
{
int_ = other.int_;
return *this;
}
~MyInt()
{
int_ = 0;
}
};
template<class Allocator, template <class, class> class Vector>
void vector_test_template(unsigned int num_iterations, unsigned int num_elements, bool csv_output)
{
typedef typename Allocator::template rebind<MyInt>::other IntAllocator;
unsigned int numalloc = 0, numexpand = 0;
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
typedef stats_traits<Vector> stats_traits_t;
#endif
cpu_timer timer;
timer.resume();
unsigned int capacity = 0;
for(unsigned int r = 0; r != num_iterations; ++r){
Vector<MyInt, IntAllocator> v;
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
stats_traits_t::reset_alloc_stats(v);
#endif
//v.reserve(num_elements);
//MyInt a[3];
/*
for(unsigned int e = 0; e != num_elements/3; ++e){
v.insert(v.end(), &a[0], &a[0]+3);
}*/
/*
for(unsigned int e = 0; e != num_elements/3; ++e){
v.insert(v.end(), 3, MyInt(e));
}*/
/*
for(unsigned int e = 0; e != num_elements/3; ++e){
v.insert(v.empty() ? v.end() : --v.end(), &a[0], &a[0]+3);
}*/
/*
for(unsigned int e = 0; e != num_elements/3; ++e){
v.insert(v.empty() ? v.end() : --v.end(), 3, MyInt(e));
}*/
/*
for(unsigned int e = 0; e != num_elements/3; ++e){
v.insert(v.size() >= 3 ? v.end()-3 : v.begin(), &a[0], &a[0]+3);
}*/
/*
for(unsigned int e = 0; e != num_elements/3; ++e){
v.insert(v.size() >= 3 ? v.end()-3 : v.begin(), 3, MyInt(e));
}*/
/*
for(unsigned int e = 0; e != num_elements; ++e){
v.insert(v.end(), MyInt(e));
}*/
/*
for(unsigned int e = 0; e != num_elements; ++e){
v.insert(v.empty() ? v.end() : --v.end(), MyInt(e));
}*/
for(unsigned int e = 0; e != num_elements; ++e){
v.push_back(MyInt(e));
}
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
numalloc += stats_traits_t::get_num_alloc(v);
numexpand += stats_traits_t::get_num_expand(v);
#endif
capacity = static_cast<unsigned int>(v.capacity());
}
timer.stop();
nanosecond_type nseconds = timer.elapsed().wall;
if(csv_output){
std::cout << get_allocator_name<Allocator>::get()
<< ";"
<< num_iterations
<< ";"
<< num_elements
<< ";"
<< capacity
<< ";"
<< float(nseconds)/(num_iterations*num_elements)
<< ";"
<< (float(numalloc) + float(numexpand))/num_iterations
<< ";"
<< float(numalloc)/num_iterations
<< ";"
<< float(numexpand)/num_iterations
<< std::endl;
}
else{
std::cout << std::endl
<< "Allocator: " << get_allocator_name<Allocator>::get()
<< std::endl
<< " push_back ns: "
<< float(nseconds)/(num_iterations*num_elements)
<< std::endl
<< " capacity - alloc calls (new/expand): "
<< (unsigned int)capacity << " - "
<< (float(numalloc) + float(numexpand))/num_iterations
<< "(" << float(numalloc)/num_iterations << "/" << float(numexpand)/num_iterations << ")"
<< std::endl << std::endl;
}
boost_cont_trim(0);
}
void print_header()
{
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
<< "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";"
<< "New allocations" << ";" << "Fwd expansions" << std::endl;
}
int main(int argc, const char *argv[])
{
#define SINGLE_TEST
#ifndef SINGLE_TEST
#ifdef NDEBUG
unsigned int numit [] = { 10000, 100000, 1000000, 10000000 };
#else
unsigned int numit [] = { 100, 1000, 10000, 100000 };
#endif
unsigned int numele [] = { 10000, 1000, 100, 10 };
#else
#ifdef NDEBUG
std::size_t numit [] = { 10000 };
#else
std::size_t numit [] = { 100 };
#endif
std::size_t numele [] = { 10000 };
#endif
bool csv_output = argc == 2 && (strcmp(argv[1], "--csv-output") == 0);
if(csv_output){
print_header();
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<StdAllocator, bc::vector>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV1, bc::vector>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV2Mask, bc::vector>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV2, bc::vector>(numit[i], numele[i], csv_output);
}
}
else{
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
std::cout << "\n ----------------------------------- \n"
<< " Iterations/Elements: " << numit[i] << "/" << numele[i]
<< "\n ----------------------------------- \n";
vector_test_template<StdAllocator, std::vector>(numit[i], numele[i], csv_output);
vector_test_template<StdAllocator, bc::vector>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV1, bc::vector>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV2Mask, bc::vector>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV2, bc::vector>(numit[i], numele[i], csv_output);
}
}
return 0;
}
+166
View File
@@ -0,0 +1,166 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#pragma warning (disable : 4512)
#endif
#include <boost/container/allocator.hpp>
#define BOOST_CONTAINER_VECTOR_ALLOC_STATS
#include <boost/container/vector.hpp>
#undef BOOST_CONTAINER_VECTOR_ALLOC_STATS
#include <memory> //std::allocator
#include <iostream> //std::cout, std::endl
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
namespace bc = boost::container;
typedef std::allocator<int> StdAllocator;
typedef bc::allocator<int, 2> AllocatorPlusV2;
typedef bc::allocator<int, 1> AllocatorPlusV1;
template<class Allocator> struct get_allocator_name;
template<> struct get_allocator_name<StdAllocator>
{ static const char *get() { return "StdAllocator"; } };
template<> struct get_allocator_name<AllocatorPlusV2>
{ static const char *get() { return "AllocatorPlusV2"; } };
template<> struct get_allocator_name<AllocatorPlusV1>
{ static const char *get() { return "AllocatorPlusV1"; } };
class MyInt
{
int int_;
public:
MyInt(int i = 0) : int_(i){}
MyInt(const MyInt &other)
: int_(other.int_)
{}
MyInt & operator=(const MyInt &other)
{
int_ = other.int_;
return *this;
}
};
void print_header()
{
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
<< "num_shrink" << ";" << "shrink_to_fit(ns)" << std::endl;
}
template<class Allocator>
void vector_test_template(unsigned int num_iterations, unsigned int num_elements, bool csv_output)
{
typedef typename Allocator::template rebind<MyInt>::other IntAllocator;
unsigned int capacity = 0;
const std::size_t Step = 5;
unsigned int num_shrink = 0;
(void)capacity;
cpu_timer timer;
timer.resume();
typedef bc::container_detail::integral_constant
<unsigned, bc::container_detail::version<Allocator>::value> alloc_version;
for(unsigned int r = 0; r != num_iterations; ++r){
bc::vector<MyInt, IntAllocator> v(num_elements);
v.reset_alloc_stats();
num_shrink = 0;
for(unsigned int e = num_elements; e != 0; e -= Step){
v.erase(v.end() - Step, v.end());
v.shrink_to_fit();
assert( (alloc_version::value != 2) || (e == Step) || (v.num_shrink > num_shrink) );
num_shrink = v.num_shrink;
}
assert(v.empty());
assert(0 == v.capacity());
}
timer.stop();
nanosecond_type nseconds = timer.elapsed().wall;
if(csv_output){
std::cout << get_allocator_name<Allocator>::get()
<< ";"
<< num_iterations
<< ";"
<< num_elements
<< ";"
<< num_shrink
<< ";"
<< float(nseconds)/(num_iterations*num_elements)
<< std::endl;
}
else{
std::cout << std::endl
<< "Allocator: " << get_allocator_name<Allocator>::get()
<< std::endl
<< " num_shrink: " << num_shrink
<< std::endl
<< " shrink_to_fit ns: "
<< float(nseconds)/(num_iterations*num_elements)
<< std::endl << std::endl;
}
boost_cont_trim(0);
}
int main(int argc, const char *argv[])
{
#define SINGLE_TEST
#ifndef SINGLE_TEST
unsigned int numit [] = { 100, 1000, 10000 };
unsigned int numele [] = { 10000, 2000, 500 };
#else
unsigned int numit [] = { 500 };
unsigned int numele [] = { 2000 };
#endif
bool csv_output = argc == 2 && (strcmp(argv[1], "--csv-output") == 0);
if(csv_output){
print_header();
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<StdAllocator>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV1>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
vector_test_template<AllocatorPlusV2>(numit[i], numele[i], csv_output);
}
}
else{
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
std::cout << "\n ----------------------------------- \n"
<< " Iterations/Elements: " << numit[i] << "/" << numele[i]
<< "\n ----------------------------------- \n";
vector_test_template<StdAllocator>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV1>(numit[i], numele[i], csv_output);
vector_test_template<AllocatorPlusV2>(numit[i], numele[i], csv_output);
}
}
return 0;
}
@@ -0,0 +1,287 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#pragma warning (disable : 4512)
#pragma warning (disable : 4541)
#pragma warning (disable : 4673)
#pragma warning (disable : 4671)
#pragma warning (disable : 4244)
#endif
#include <memory> //std::allocator
#include <iostream> //std::cout, std::endl
#include <vector> //std::vector
#include <cstddef> //std::size_t
#include <boost/container/allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
#include <boost/container/stable_vector.hpp>
#include <boost/container/vector.hpp>
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
namespace bc = boost::container;
typedef std::allocator<int> StdAllocator;
typedef bc::allocator<int, 1> AllocatorPlusV1;
typedef bc::allocator<int, 2> AllocatorPlusV2;
typedef bc::adaptive_pool
< int
, bc::ADP_nodes_per_block
, 0//bc::ADP_max_free_blocks
, 2
, 2> AdPool2PercentV2;
template<class Allocator> struct get_allocator_name;
template<> struct get_allocator_name<StdAllocator>
{ static const char *get() { return "StdAllocator"; } };
template<> struct get_allocator_name<AllocatorPlusV1>
{ static const char *get() { return "AllocatorPlusV1"; } };
template<> struct get_allocator_name<AllocatorPlusV2>
{ static const char *get() { return "AllocatorPlusV2"; } };
template<> struct get_allocator_name<AdPool2PercentV2>
{ static const char *get() { return "AdPool2PercentV2"; } };
class MyInt
{
int int_;
public:
MyInt(int i = 0) : int_(i){}
MyInt(const MyInt &other)
: int_(other.int_)
{}
MyInt & operator=(const MyInt &other)
{
int_ = other.int_;
return *this;
}
};
template<class Allocator>
struct get_vector
{
typedef bc::vector
<MyInt, typename Allocator::template rebind<MyInt>::other> type;
static const char *vector_name()
{
return "vector<MyInt>";
}
};
template<class Allocator>
struct get_stable_vector
{
typedef bc::stable_vector
<MyInt, typename Allocator::template rebind<MyInt>::other> type;
static const char *vector_name()
{
return "stable_vector<MyInt>";
}
};
template<template<class> class GetContainer, class Allocator>
void stable_vector_test_template(unsigned int num_iterations, unsigned int num_elements, bool csv_output)
{
typedef typename GetContainer<Allocator>::type vector_type;
//std::size_t top_capacity = 0;
nanosecond_type nseconds;
{
{
vector_type l;
cpu_timer timer;
timer.resume();
for(unsigned int r = 0; r != num_iterations; ++r){
l.insert(l.end(), num_elements, MyInt(r));
}
timer.stop();
nseconds = timer.elapsed().wall;
if(csv_output){
std::cout << get_allocator_name<Allocator>::get()
<< ";"
<< GetContainer<Allocator>::vector_name()
<< ";"
<< num_iterations
<< ";"
<< num_elements
<< ";"
<< float(nseconds)/(num_iterations*num_elements)
<< ";";
}
else{
std::cout << "Allocator: " << get_allocator_name<Allocator>::get()
<< '\t'
<< GetContainer<Allocator>::vector_name()
<< std::endl
<< " allocation ns: "
<< float(nseconds)/(num_iterations*num_elements);
}
// top_capacity = l.capacity();
//Now preprocess ranges to erase
std::vector<typename vector_type::iterator> ranges_to_erase;
ranges_to_erase.push_back(l.begin());
for(unsigned int r = 0; r != num_iterations; ++r){
typename vector_type::iterator next_pos(ranges_to_erase[r]);
std::size_t n = num_elements;
while(n--){ ++next_pos; }
ranges_to_erase.push_back(next_pos);
}
//Measure range erasure function
timer.stop();
timer.start();
for(unsigned int r = 0; r != num_iterations; ++r){
std::size_t init_pos = (num_iterations-1)-r;
l.erase(ranges_to_erase[init_pos], l.end());
}
timer.stop();
nseconds = timer.elapsed().wall;
assert(l.empty());
}
}
if(csv_output){
std::cout << float(nseconds)/(num_iterations*num_elements)
<< std::endl;
}
else{
std::cout << '\t'
<< " deallocation ns: "
<< float(nseconds)/(num_iterations*num_elements)/*
<< std::endl
<< " max capacity: "
<< static_cast<unsigned int>(top_capacity)
<< std::endl
<< " remaining cap. "
<< static_cast<unsigned int>(top_capacity - num_iterations*num_elements)
<< " (" << (float(top_capacity)/float(num_iterations*num_elements) - 1)*100 << " %)"*/
<< std::endl << std::endl;
}
assert(boost_cont_all_deallocated());
boost_cont_trim(0);
}
void print_header()
{
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
<< "Insertion time(ns)" << ";" << "Erasure time(ns)" << ";"
<< std::endl;
}
void stable_vector_operations()
{
{
bc::stable_vector<int> a(bc::stable_vector<int>::size_type(5), 4);
bc::stable_vector<int> b(a);
bc::stable_vector<int> c(a.cbegin(), a.cend());
b.insert(b.cend(), 0);
c.pop_back();
a.assign(b.cbegin(), b.cend());
a.assign(c.cbegin(), c.cend());
a.assign(1, 2);
}
{
typedef bc::stable_vector<int, std::allocator<int> > stable_vector_t;
stable_vector_t a(bc::stable_vector<int>::size_type(5), 4);
stable_vector_t b(a);
stable_vector_t c(a.cbegin(), a.cend());
b.insert(b.cend(), 0);
c.pop_back();
assert(static_cast<std::size_t>(a.end() - a.begin()) == a.size());
a.assign(b.cbegin(), b.cend());
assert(static_cast<std::size_t>(a.end() - a.begin()) == a.size());
a.assign(c.cbegin(), c.cend());
assert(static_cast<std::size_t>(a.end() - a.begin()) == a.size());
a.assign(1, 2);
assert(static_cast<std::size_t>(a.end() - a.begin()) == a.size());
a.reserve(100);
assert(static_cast<std::size_t>(a.end() - a.begin()) == a.size());
}
}
int main(int argc, const char *argv[])
{
#define SINGLE_TEST
#ifndef SINGLE_TEST
#ifdef NDEBUG
unsigned int numit [] = { 400, 4000, 40000, 400000 };
#else
unsigned int numit [] = { 4, 40, 400, 4000 };
#endif
unsigned int numele [] = { 10000, 1000, 100, 10 };
#else
#ifdef NDEBUG
unsigned int numit [] = { 400 };
#else
unsigned int numit [] = { 4 };
#endif
unsigned int numele [] = { 10000 };
#endif
//Warning: range erasure is buggy. Vector iterators are not stable, so it is not
//possible to cache iterators, but indexes!!!
bool csv_output = argc == 2 && (strcmp(argv[1], "--csv-output") == 0);
if(csv_output){
print_header();
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_stable_vector, StdAllocator>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_vector, StdAllocator>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_stable_vector, AllocatorPlusV1>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_vector, AllocatorPlusV1>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_stable_vector, AllocatorPlusV2>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_vector, AllocatorPlusV2>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_stable_vector, AdPool2PercentV2>(numit[i], numele[i], csv_output);
}
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
stable_vector_test_template<get_vector, AdPool2PercentV2>(numit[i], numele[i], csv_output);
}
}
else{
for(unsigned int i = 0; i < sizeof(numele)/sizeof(numele[0]); ++i){
std::cout << "\n ----------------------------------- \n"
<< " Iterations/Elements: " << numit[i] << "/" << numele[i]
<< "\n ----------------------------------- \n";
stable_vector_test_template<get_stable_vector, StdAllocator>(numit[i], numele[i], csv_output);
stable_vector_test_template<get_vector, StdAllocator>(numit[i], numele[i], csv_output);
stable_vector_test_template<get_stable_vector, AllocatorPlusV1>(numit[i], numele[i], csv_output);
stable_vector_test_template<get_vector, AllocatorPlusV1>(numit[i], numele[i], csv_output);
stable_vector_test_template<get_stable_vector, AllocatorPlusV2>(numit[i], numele[i], csv_output);
stable_vector_test_template<get_vector, AllocatorPlusV2>(numit[i], numele[i], csv_output);
stable_vector_test_template<get_stable_vector, AdPool2PercentV2>(numit[i], numele[i], csv_output);
stable_vector_test_template<get_vector, AdPool2PercentV2>(numit[i], numele[i], csv_output);
}
}
return 0;
}