Boost logo

Boost :

Subject: Re: [boost] interest in structure of arrays container?
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2016-10-21 01:48:45


On 10/20/2016 10:02 PM, Larry Evans wrote:
> On 10/19/2016 11:59 PM, Michael Marcin wrote:
>> On 10/19/2016 7:32 AM, Larry Evans wrote:
>>>> Michael, the attached is an outline of how to do it.
>>>> As noted in the comments, a lot of member functions still need
>>>> implementation; however, the offset calculations I think are
>>>> correct.
>>>>
>>> Code has been updated to implement most of the "essentials" of
>>> soa_block. You can now call begin<Index> to get the begin
>>> iterator for the Index'th vector.
>>>
>>> The code now is on github at:
>>>
>>> https://github.com/cppljevans/soa/blob/master/soa_block.cpp
>>>
>>
>> Still digesting this but one small tidbit I stood out for me
>>
> [snip]
> I uploaded a modification of your benchmark:
>
> http://codepad.org/eol6auRN
>
> to:
> https://github.com/cppljevans/soa/blob/master/codepad.eol6auRN.cpp
>
> The modification added soa_emitter_block_t which uses soa_block.
> Unfortunately, this soa_emitter_block_t takes about twice as long as
> your soa_emitter_static_t.
>
> I've no idea why. Any guesses?
>

2x is quite an abstraction penalty.
I can only assume your compiler is failing to optimize away some part of
the abstraction.

FWIW on vs2015 I'm not seeing nearly as much of a difference.

particle_count=1,000,000
AoS in 6.34667 seconds
SoA in 4.26384 seconds
SoA flat in 4.16572 seconds
SoA Static in 5.4037 seconds
SoA block in 5.5588 seconds


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