>Unsure how much time I should sink into this though.
You should stop immediately once you start learning less and are fixating on hyper specific problems.
>I also debated generating all the numbers at once into an array, throwing it into CPU cache
You don't control the cache. I recommend that you treat the CPU as a black box, strictly until you can no longer so so. If you are learning C and aren't even writing multi threaded code, you should not fixate on the specifics of how the CPU handles memory.
Please pretend that is true. Manipulating cache is difficult. And you should worry about other things. This will become important when you are doing multi threading.
You should stop immediately once you start learning less and are fixating on hyper specific problems.
>I also debated generating all the numbers at once into an array, throwing it into CPU cache
You don't control the cache. I recommend that you treat the CPU as a black box, strictly until you can no longer so so. If you are learning C and aren't even writing multi threaded code, you should not fixate on the specifics of how the CPU handles memory.
Please pretend that is true. Manipulating cache is difficult. And you should worry about other things. This will become important when you are doing multi threading.