Boost logo

Boost :

Subject: Re: [boost] interest in structure of arrays container?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2016-10-21 08:50:42


On 10/21/2016 03:01 AM, Larry Evans wrote:
> On 10/21/2016 01:39 AM, Larry Evans wrote:
>> On 10/21/2016 01:07 AM, Michael Marcin wrote:
>>> On 10/21/2016 12:48 AM, Michael Marcin wrote:
>>>> On 10/20/2016 10:02 PM, Larry Evans wrote:
>>>>>
>>>>> 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.
>>
>> OOPS. Yeah, I forgot about run-time optimization compiler flags :(
>>
> [snip]
> Using optimization flag, -O2, (and maybe soa_block.begin_all) makes
> soa_block fastest
[snip]
But only fastest by a small amount.

I can't imagine how anything could be faster
than the soa_emitter_static_t because it uses a tuple of
std::array<T,particle_count>. I'd guess that the
soa_emitter_block_t is only faster by luck (maybe during
the soa_emitter_block_t run, my machine was not as busy on some other
stuff).

I've not much experience with benchmarking; so, take my reasoning
with a grain of salt.

-regards,
Larry


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