Mail Archives: djgpp/1997/11/05/16:01:16
Ok don't want to start a war here but...
I'm new-ish to C and I am looking for ways to speed up my code.
I don't care a whit about readability and maitainability of code, or
the size of code generated (As long as it runs on clean 16Mb system). I
just want the best performance poss. (for games programming).
1) structs - Are they slow? what do they compile to?
2) unrolling loops - to what extent does -funroll-loops do this? Does -
O3 do this? Adding both I get an excecutable of exactly the same size as
using just -O. Should I just manually unroll the loops?
3) global variables - I heard, read, dreamt something about them being
faster. ie declare all variables at top of prog and just be careful
about accessing wrong ones, etc.
Any help appreciated.
Self-proclaimed gods need not reply.
Remove the (you know what) to Reply
--
Alistair Bain
AHBain AT NOSPAMPLEASEWEREBRITISH DOT pulsedesign DOT demon DOT co DOT uk
- Raw text -