It's a good thing that FIFO isn't the only Memory & Cache Replacement Strategy [0]. Way back when, I wrote a Cache Simulator in HTML+JS [1][2]. Hasn't aged well; you used to be able to drag and drop a list a file containing a list of addresses. I ought to clean it up and make it functional again.<p>I've sometimes wondered if a Cache Line Size-aware Strategy could significantly improve Garbage Collection. I've mentally toyed with the idea of a Linked List of bitmaps of Arenas (made of Cache Line Sized chunks) with a Reference Counter bitlist could improve GC performance. It could even be extended for use in non-OOP languages with the GCC RAII Cleanup Extension [3], even for primitive and other non-OOP types.<p>[0] <a href="https://en.m.wikipedia.org/wiki/Cache_replacement_policies" rel="nofollow">https://en.m.wikipedia.org/wiki/Cache_replacement_policies</a><p>[1] <a href="https://github.com/lpsantil/CacheSimulator/blob/master/index.html" rel="nofollow">https://github.com/lpsantil/CacheSimulator/blob/master/index...</a><p>[2] <a href="http://lpsantil.github.io/CacheSimulator/" rel="nofollow">http://lpsantil.github.io/CacheSimulator/</a><p>[3] <a href="https://en.wikipedia.org/wiki/Resource_acquisition_is_initialization#Compiler_%22cleanup%22_extensions" rel="nofollow">https://en.wikipedia.org/wiki/Resource_acquisition_is_initia...</a>
Maybe it's 4am and I ought to sleep, but I'm having trouble understanding this article.<p>Is this phenomenon the same reason some PC game engines render objects in alternating reverse order each frame, rather than something theoretically more optimal like depth-sorted? I understand that in the case of 3D graphics if the textures don't fit in the GPUs memory, FIFO ordering will cause ALL textures to be ejected every frame as you cycle through the same objects in the same order, whereas reversing the order every frame means just the same batch of overflow textures "at the end" will get ejected every other frame.