3 ms·
I mean, the #1 job of any optimizing programmer is rather simple when you think of it. 1. Program attempt A. 2. Program attempt B using the same interface. 3
by dragontamer 5y ago
I mean, the #1 job of any optimizing programmer is rather simple when you think of it.
1. Program attempt A.
2. Program attempt B using the same interface.
3. Develop a suite of tests.
4. Profile A and B using those tests.
5. Choose the methodology that uses fewer resources (in particular: time, memory, cache).
6. Use experience from 1-5 to make attempt C. Then repeat again.
#5 is worded like that on purpose. Different programs will be constrained by different resources. Time itself is often times a constraint on resources (run out of RAM, your program can continue but only through Swap. Run out of L3 cache, your program will continue, but through RAM). A methodology that uses less RAM will stay in L1 cache longer, but if everyone's data is so huge you're in DDR4, maybe a different methodology would work instead.