Questions tagged [cache-locality]

25 questions
0
votes
2 answers

Can a custom allocator improve cache locality for lists?

This is a rather hypothetical question. I only have limited knowledge about how the cpu cache works. I know a cpu loads subsequent bytes into the cache. Since a list uses pointers/indirection into random locations in memory, it has relatively bad…
Raildex
  • 3,406
  • 1
  • 18
  • 42
0
votes
1 answer

Determining optimal block size for blocked matrix multiplication

I am trying to implement blocked (tiled) matrix multiplication on a single processor. I have read the literature on why blocking improves memory performance, but I just wanted to ask how to determine the optimal block size. I need to perform C+A*B…
user14634701
0
votes
0 answers

Cache locality considerations

I have been trying to get better awareness of cache locality. I produced the 2 code snippets to gain better understanding of the cache locality characteristics of both. vector v1(1000, some random numbers); vector v2(1000, some random…
roulette01
  • 1,984
  • 2
  • 13
  • 26
0
votes
1 answer

Understanding data cache locality in mips code

I have been browsing stackoverflow could not really find a example regarding to this one. I understand the concept of Temporal and Spatial locality for data cache: Temporarl locality: address revisited Spatial locality: every x times memory access…
nihulus
  • 1,475
  • 4
  • 24
  • 46
0
votes
3 answers

What is the difference in the Code Snippets?

I am a beginner in operating systems, and I am trying to understand some code snippets. Can you please explain to me the difference between these code snippets?? int sum_array_rows(int a[M][N]) { int i,j,sum=0; for(i=0;i
Jane
  • 77
  • 1
  • 11
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
1 answer

Ranges of nested for-loops when locality is improved (C++)

I have the following nested for loop: int n = 8; int counter = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { printf("(%d, %d)\n", i, j); counter++; } } Which prints (0,1) to (6,7) as expected and…
BodneyC
  • 110
  • 1
  • 11
0
votes
1 answer

Apache Drill database and data locality

I have two servers. The first server (A) contains the zookeeper, a mongodb database and a drillbit. The second server (B) contains a hadoop distribution with several hive tables, a postgresql database and the other drillbit. Both drillbits can see…
Ivan
  • 1
  • 2
0
votes
1 answer

C++ : vector of vector and cache locality

I am looking for a library/solution that will alleviate the rather important number of cache miss I am experiencing in my program class Foo{ std::vector myVec; // Rest of the class }; int main(){ // Some code …
B. Decoster
  • 7,723
  • 1
  • 32
  • 52
-1
votes
2 answers

Cache Locality - weight of TLB, Cache Lines, and ...?

From my understanding the constructs which give rise to the high level concept of "cache locality" are the following: Translation Lookaside Buffer (TLB) for virtual memory translation. Accessing the same virtual memory within the 4096 byte…
1
2