|
Boost : |
Subject: Re: [boost] [poly_collection] Request for comments: fast polymorphic collections
From: Larry Evans (cppljevans_at_[hidden])
Date: 2016-11-06 11:11:57
On 11/06/2016 06:25 AM, Joaquin M López Muñoz wrote:
> A couple of years ago I wrote two blog entries about high-performance
> data structures
> for polymorphic objects:
>
> http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections.html
>
http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections-with.html
>
> that spurred some interest in the community. Now I've had the time to
> turn these
> ideas into something resembling a full-fledged library:
>
> https://github.com/joaquintides/poly_collection
>
http://rawgit.com/joaquintides/poly_collection/website/doc/html/index.html
>
> and I'd be very grateful if people could give their opinion on
> usefulness, design, etc.
> so as to determine potential interest in an eventual official submission
> to Boost.
>
> Thank you,
>
> JoaquÃn M López Muñoz
>
Thanks for the update Joaquin.
I noticed you also mentioned this library in reponse to
another thread here:
http://lists.boost.org/Archives/boost/2016/10/231186.php
which made me wonder how it would perform in the benchmark
mentioned in that thread:
https://github.com/cppljevans/soa/blob/master/soa_compare.benchmark.cpp
But then, I looked at the documentation here:
and it looked like there was a separate pointer for each
type. Hence, the storage looks like it would be simllar to:
template<typename... Ts>
soa_tuple=std::tuple<std::vector<Ts>...>;
where the separate pointers would be the data() pointer for
each element in soa_tuple. IOW, the storage would be like
that of particles here:
https://github.com/cppljevans/soa/blob/master/soa_compare.benchmark.cpp#L278
Hence, I'm wondering what's the advantage of your library's
base_collection compared to the soa_tuple. Now, if you say
soa_tuple contains duplicate entries of size(), then I could
ask what's the advantage of base_collection vs that of the
particles at:
https://github.com/cppljevans/soa/blob/master/soa_compare.benchmark.cpp#L456
where there's just a single pointer to a contiguous block of
storage:
https://github.com/cppljevans/soa/blob/master/soa_block.hpp#L30
and the pointers to the specific types are given by the
soa_block::begin_all function:
https://github.com/cppljevans/soa/blob/master/soa_block.hpp#L294
in the soa_block<Ts...> type of the particles?
Maybe you could provide another implentation of the
emitter_t using your base_collection to see how they
compare.
-regards,
Larry
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk