c - How to store array to fit cache line size -


i want have array 32 elements of 64bit numbers : long int arr[32];

however cache line size 64 bytes. mean array not go @ cache system or rather of elements do?

would fit cache if split array two-dimensional : long int arr[4][8]; ?

  1. your array 256 bytes, not fit in 1 64 byte cache line.
  2. splitting array won't decrease size, #1 still applies.
  3. your cpu has multiple cache lines, it's 256 bytes fit in whatever cache worried about.

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo