justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[back to index] | [unreplied] | [replied] | [recent comments] | [all]

Question: Hey Justin, is there wisdom you can share when it comes to optimization, since you might be the best at it, to my knowledge? Anything can help, either for making software, a website, games, etc.
Asked by Rano (103.182.107.x) on May 27 2026, 5:23am
Reply on May 27 2026, 1:11pm:
    I doubt I'm the best at it, but I could be worse! I'd say don't optimize prematurely (wait until you find a real bottleneck)... then look for algorithmic optimizations before you start optimizing the specifics of the implementation. and think about memory access patterns, since things in-order are generally faster than randomly dancing around. but the key is: always measure and confirm that the thing you're doing is faster in real-world cases...


Comments:
  • Posted by jack (91.90.123.x) on May 27 2026, 10:09pm:
    re:games You rarely need data structures more complicated than simple arrays, try and stay cache friendly, switch to arrays of structs rather than structs of arrays depending on access patterns, fixed-size stuff as much as you can when bounds are known, and allocate all resources up front, manage it yourself, no runtime allocations. Those are the big ones from my experience.

  • Posted by Justin on May 28 2026, 1:03am:
    yeah heaps are usually fast but the concurrency issues are there. maybe you have arrays of structs / structs of arrays backwards there, most people start with arrays of structs...


Comment:
    Your Name:   -- Site Owner's Name:  (for human-verification)

    Comment:    

    
  
[back to index] | [unreplied] | [replied] | [recent comments] | [all]
Copyright 2026 Justin Frankel. | RSS