News for hackers. Stuff that matters.
Re:I had to give a wrong answer to get the job (2017) by fulafel on Monday July 19, 2021 @05:37PM (#27887537)
Games work with time budgets of many milliseconds per frame, relatively long timescales from a cpu pov. It is rare to prefer predictable per iteration latency in loops over higher throughput unless the deferred batch of work is quite big. But of course this can compound in some cases, eg you have thousands of these arrays being extended in lockstep and they all trigger the extra work at the same time...
Re:I had to give a wrong answer to get the job (2017) by Dylan16807 on Monday July 19, 2021 @09:23PM (#27889180)
If the arrays are big enough for growing them to mess up your time budget, then it's quite likely that a linked list would already be failing.
Re:I had to give a wrong answer to get the job (2017) by fulafel on Tuesday July 20, 2021 @03:49AM (#27891017)
Yep, and the associated dynamic memory allocation for LL nodes will still have latency spikes from the malloc implementation so its worst case latency is still bad.