Other > Game Development

Optimization Techniques

(1/3) > >>

TechSY730:
What sort of intermediate to advanced optimization techniques do you use? Such as

Loop unrolling
Loop merging
Lazy initialization
Precomputing of constant values
Keeping lists sorted to reduce look-up times (assuming inserts are much rarer than look-ups)
Avoiding making copies made by passing by value
Sharing of internal data structures of two similar immutable objects
Tail-recursion
Rearranging code and variables to improve cache hits and pipe-lining
Rearranging branches to improve branch prediction
Replacing a set of operations with their MMX or SSE counterparts
Hand tuning assembly of critical loops
(Okay, maybe those last four were a little too low-level  ;D)
Or any other optimizations I didn't mention?

x4000:
Yes, lots of that sort of thing, plus various optimizations that are .NETE/mono specific.  Avoiding foreach statements is a huuge one.

Very low on time these days, can't really chat about this at the moment, sorry.  Just very slammed trying to get things done for the holidays and actually being able to take time off.

TechSY730:
No problem, you can elaborate in more detail once things get a little less hectic if you want to.

x4000:
Note that a lot of those things don't work when you're in JIT languages.  There's a whole other art to doing stuff in specific higher-level languages, and most of those vary by langauge.  A lot of them are so ingrained in my habits (and Keith's as well, I think) that we don't really think of them.  But your list has a mix of general logical refinements (which of course we use), and hardware-specific lower-level-C++ type stuff that doesn't make any sense in C#.

TechSY730:
True, hence my "joke" optimizations of low level concepts. When you get more time to answer; are there any convoluted, strange but efficient algorithms you are using?

Navigation

[0] Message Index

[#] Next page

Go to full version