Efficiency in C and C++ -


so teacher tells me should compute intermediate results needed on fly rather storing them, because speed of processors nowadays more faster speed of memory.

so when compute intermediate result, need use memory right ? can please explain me ?

so when compute intermediate result, need use memory right ? can please explain me?

there several levels of memory in computer. layers this

  1. registers – cpu calculations on , access instant
  2. caches - memory that's tightly coupled cpu core; memory accesses main system memory go through cache , program looks if data goes , comes system memory. if data present in cache , access aligned access instant , hence fast.
  3. main system memory - connected cpu through memory controller , shared cpu cores in system. accessing main memory introduces latencies through addressing , limited bandwidth between memory , cpus

when work in-situ calculated intermediary results never leave registers or may go far cache , not limited available system memory bandwidth or blocked memory bus arbitration or address generation interlock.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -