3 ms·
gens's* law of writing software that performs well: Don't be smart. Do simple data structures where you can. Arrays, AoA, SoA, AoS. Process data in bulk where
by gens 10y ago
gens's* law of writing software that performs well: Don't be smart.
Do simple data structures where you can. Arrays, AoA, SoA, AoS. Process data in bulk where you can. Put complex algorithms only where needed (kd-tree when doing something like raytracing, threading only when necessary and even then only with bulk processing, complex locking or timing mechanisms only when you have to, etc.). Don't follow paradigms blindly.
Basically data should be processed only in a functional way or in "waves". When there are only a handful of variables, a functional way will keep them in cpu registers. When there is more data, going over an array will make the cpu load the data that is to come next into the cache.
Oh, and write C.
[*] gens is a hobby programmer and possibly an idiot