Cache
#33
Replies: 3 comments
-
Cache (캐시)
Cache Hit
Cache Miss
Cache Mapping
1. Direct Mapping (직접 매핑)
장점
단점
2. Associative Mapping (연관 매핑)
장점
단점
3. Set Associative Mapping (집합 연관 매핑)
장단점
Cache Locality (캐시 지역성)1. Temporal Locality (시간적 지연성)
2. Spatial Locality (공간적 지역성)
Q) 교체 정책(교체 알고리즘) 종류와 각각 설명1. Random
장점
단점
2. FIFO (First In First Out)
장점
단점
3. LFU (Least Frequently Used)
장점
단점
4. LRU (Least Recently Used)
장점
단점
5. NUR (Not Used Recently)
장점
단점
6. Optimal
장점
단점
참고 |
Beta Was this translation helpful? Give feedback.
0 replies
-
❓ 캐시 히트, 캐시 미스, 캐시 매핑 이란 무엇일까요?🌱 [ Cache ] : 빠른 장치와 느린 장치의 속도 차이를 줄이기 위해 사용되는 임시 저장소
🌱 [ 캐시의 지역성 ]
[ 시간적 지역성 ] : 최근에 사용한 데이터를 다시 사용 하려는 특성
[ 공간적 지역성 ] : 최근에 사용한 데이터에 가까운 공간에 접근하는 특성 long total = 0;
long startTime = System.currentTimeMillis();
for(int i = 0; i < ROW_COUNT; i++){
for(int j = 0; j < COL_COUNT; j++){
total += arr[i][j];
}
}
[ 실험 ] 연속 할당 된 arr[row][col], 연속 할당 되지 않은 arr[col][row] 조회 성능 total += arr[i][j]; / total += arr[j][i]; 🌱 [ 캐시 매핑 ]
[ 직접 매핑 ] : 메인 메모리와 동일한 배열로 매핑하는 방법
[ 연관 매핑 ] : 캐시 데이터는 메인 메모리 순서와는 관련이 없다. 🌱 [ 교체 정책 ]FIFO ( First In First Out )
LFU ( Least Frequently Used )
LRU (Least Recently Used )
[ LRU ]
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment










Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions