This is the mail archive of the
mailing list for the GCC project.
Re: g++ 4.3, troubles with C++ indexing idioms
On 7/24/07, Richard Guenther <firstname.lastname@example.org> wrote:
For performance small arrays should be the same as individual members
(I can see the annoying fact that initialization is a headache - this has
annoyed me as well). For larger arrays (>4 members), aliasing will
make a difference possibly, making the array variant slower. Any union
variant is expected to be slower for aliasing reasons (we do not do
field-sensitive aliasing for unions).
And thanks for the clue about the threshold.
In the end I would still recommend to go with array variants.
I guess wishful thinking, or heresy, got me asking for a sanctioned
address-this-as-an-array idiom.; now i'll go with the flow and use
those 2nd class citizens of C++ aka array, even if i'm a bit sceptical
about the performance equivalence (granted it isn't as obvious as it
used to be, i need to investigate some more).
But for sure it can't be as terrible as unions...