|
Boost Users : |
Subject: Re: [Boost-users] PolyCollection requiring copyable
From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2017-10-04 20:59:40
El 04/10/2017 a las 22:38, Ion Gaztañaga via Boost-users escribió:
> On 04/10/2017 21:10, d3fault via Boost-users wrote:
>> On 10/3/17, Steven Watanabe via Boost-users
>> <boost-users_at_[hidden]> wrote:
>>> PolyCollection uses contiguous storage (aka std::vector).
>>> This requires copying when the segment is resized.
>>>
>> Ahh that makes sense. Just throwing a random idea out here: would a
>> semi-contiguous design be possible? PolyCollection could maintain a
>> list of [contiguous] segments, something along the lines of how
>> "extents" work in the filesystem world? You could get 99% cache hits
>> and only a few misses when jumping to the next segments. idk maybe
>> this idea sucks xD.
>
> I don't remember if this was commented in the review for future
> improvements,
> but it's an idea I wanted to share. If the internal sequence type to
> hold the
> collection of objects of the same type could be specified as an option, a
> deque-like sequence could allow non-movable and non-copyable types, at
> least
> when insertion position is not specified, and even stable references and
> pointers for such insertions.
What about mid deleteions?
> A stable_vector based storage would allow even more operations for such
> types, but we would loose element contiguity.
Exactly, At that point, you're probably better off with
Boost.PointerContainer
performancewise.
JoaquÃn M López Muñoz
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net