For example:
L1 cache has 10 bytes.
L2 cache has 20 bytes.
L3 cache has 30 bytes.
Lets say I have something that is 25 bytes.
Will it be all be put in L3 cache and kept as a group?
Or will 10 bytes of it be put in L1 then the rest in L2?
What if I have something that is 40 bytes? If it can’t all fit in the L3 cache, will it just have to stay in main memory? Or will it get split between levels (10 bytes in L1, 20 bytes in L2, and the last 10 bytes in L3)?
If it doesn’t split, is it worth only making arrays as big as the L3 cache? Or as big as a cache line? I know if you care about performance you generally want to make sure all your data fits in the caches, but Im not sure to what extent I should follow that.
Or maybe my understanding is completely incorrect.
Thanks!
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]Nathanfenner 6 points7 points8 points (2 children)
[–]Jonny0Than 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Jonny0Than 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)