Boost logo

Boost :

Subject: Re: [boost] Interest in a container which can hold multiple data types?
From: TONGARI J (tongari95_at_[hidden])
Date: 2015-05-07 09:54:02


2015-05-07 18:28 GMT+08:00 Joaquin M Lopez Munoz <joaquin_at_[hidden]>:

> TONGARI J <tongari95 <at> gmail.com> writes:
>
> >
> > FWIW, I made a simple proof-of-concept, it's basically a het_collection
> > with ordering.
> >
> > https://gist.github.com/jamboree/5a5797e8869168cc64d9
> >
> > Maybe someone would give it a performance test.
>
> Can't you maybe adapt the testing framework at
>
> https://www.dropbox.com/s/qy9qbf0eyf1itsy/het_collection.cpp?dl=0
>
> and run that locally?
>

https://gist.github.com/jamboree/7fca5045a1bcd880ba4b

[MSVC14 RC]
variant_sequence(no-order);variant_sequence;variant_sequence(sorted);vector_variant;
for_each:
1000;0.00741892;0.033256;0.0234027;0.045456;
10000;0.0073138;0.0325596;0.0230426;0.0449622;
100000;0.00748698;0.0391825;0.0230043;0.045153;
10000000;0.0128108;0.0405801;0.0248128;0.0497122;

[g++ 4.9.2/MinGW64]
variant_sequence(no-order);variant_sequence;variant_sequence(sorted);vector_variant;
for_each:
1000;0.0034023;0.0368542;0.00955831;0.0217586;
10000;0.003645;0.0363854;0.0095947;0.0210316;
100000;0.00367347;0.0425784;0.00957825;0.0213344;
10000000;0.00921831;0.0457604;0.0129568;0.0289718;

As expected, variant_sequence performs better than vector_variant when the
data is grouped, while it performs worse than vector_variant when the data
is dispersed.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk