Questions tagged [localityofreference]
21 questions
1
vote
1 answer
Node-Local Map reduce job
I am currently attempting to write a map-reduce job where the input data is not in HDFS and cannot be loaded into HDFS basically because the programs using the data cannot use data from HDFS and there is too much to copy it into HDFS, at least 1TB…

feldoh
- 648
- 2
- 6
- 19
0
votes
1 answer
How to count # of cache misses in theory for a matrix in memory exceeding cache size?
I'm currently considering an n x n matrix M of 64-bit integer elements stored in main memory in row-major order. I have an L1 data cache of 16KB split in 64B blocks (no L2 or L3). My code is meant to print out each element of the array one at a…

chris_lee
- 27
- 8
0
votes
1 answer
Cache effects and importance of locality
I have read this blog and I am still unsure about the importance of locality. Why is locality important for cache performance? Is it because it leads to fewer cache misses? Furthermore, how is a program written in order to achieve good locality and…

Bab
- 433
- 5
- 12
0
votes
0 answers
Expected Value of Locality
In this problem, I am asked to find the expected value of locality. I understand how the answer to the problem is
(n - 1) * (expected value of |π(i) − π(i − 1)|).
The problem solutions states that the expected value of
|π(i) − π(i − 1)| is (n +…

Zach Zhao
- 1
- 1
- 1
0
votes
1 answer
All occurrences of temporal and spatial locality of reference in a given code snippet
I have read about spatial and temporal localities.
In a couple of words.
Temporal locality:
Programs often access the same memory locations repeatedly.
Spatial locality:
Programs also often access adjacent memory locations repeatedly.
Now I'm tying…

Narek Atayan
- 1,479
- 13
- 27
0
votes
1 answer
Why is there disparity between execution time for the same code of arrays?
If I run the following program and then run it again after swapping of i and j in sum+=arr[i][j], the execution time is very different i.e. 9.8 secs compared to 2.7 secs for before the swap. I just cannot understand why it is like this. Can someone…

Ghias
- 133
- 3
- 18