|Re: alignment of data-types email@example.com (Glen Herrmannsfeldt) (2003-02-06)|
|RE: alignment of data-types firstname.lastname@example.org (Onder Karpat) (2003-02-11)|
|Re: alignment of data-types email@example.com (2003-02-11)|
|Re: alignment of data-types firstname.lastname@example.org (Mark McIntyre) (2003-02-11)|
|Re: alignment of data-types email@example.com (Glen Herrmannsfeldt) (2003-02-12)|
|From:||"Glen Herrmannsfeldt" <firstname.lastname@example.org>|
|Date:||6 Feb 2003 00:16:31 -0500|
|Posted-Date:||06 Feb 2003 00:16:31 EST|
"Mark McIntyre" <email@example.com> wrote in message
> On Tue, 4 Feb 2003 14:22:00 +0100, in comp.lang.c , "R.A. Scheltema"
> <firstname.lastname@example.org> wrote:
> >I'm currently working on a project which needs a lot of optimazation.
> >been reading some stuff on aligning data-types, which would mainly be
> >important for avoiding cach-splits and some other preformance
> The first rule of optimisation is - don't do it yet.
> The second rule is - optimise the ALGORITHM first not the code.
> The sort of stuff you're talking about is very low level and should be
> done automatically by any good optimising compiler.
> You have little or no chance of being better at it than the guys who
> wrote it, at least not till you're a guru programmer, by which stage
> you won't need to ask us for advice....
Should, but not always true.
It is common for x86 compilers to allocate double variables on 4 byte
boundaries. This was optimal on the 386 and 486, but not on pentium
and later processors. The difference can be large.
I now added comp.compilers because I didn't think of a better place to
discuss the properties of a large number of compilers on different
systems. It might be nice to know which allocate on 4 and which on 8
Return to the
Search the comp.compilers archives again.