c++ - How many cache lines are cached? -


ok can't find in way of answers this, it's simple question in memory management. know when computer pulls memory caches 32-64 bits of memory in cache line depending on processor. question store 1 cache line's worth of memory or multiple, if multiple how many?

for instance we're using c++, , pull vector<int> using loop, use integers pull information out of vector no near in memory. qualify 2 pulls , cached or going continuously pull memory? basically, pull vector<int> , store in cache, pull other vector , store in different catch line? pulling twice getting it's cached memory on? assume each vector = size of 1 catch lines worth of data.

edit: ok on same line.... have second question: lets assume moment initial vector<int> called , iterated on in loop, references multiple vectors. when caches vectors, it's going have limit start writing on previous cache right? in case in order write on previous cache lines, fifo, filo, other way?

there's different types of cache. generally, amount of cache depends on processor. moden processor has 3 levels of cache, fastest (and smallest) called l1 , range between 128kb , 512kb, slowest (and largest) 1mb 4mb.

each access memory 64 bit long, regardless of processor architecture. therefore accessing memory 64bit long operands efficient.

the cache may store memory different pages too.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -