Skip to content

Commit 5c87c4b

Browse files
committed
Update examples and remove not used import
1 parent b187010 commit 5c87c4b

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ req_miss_ratio, byte_miss_ratio = cache.process_trace(reader)
7676
print(f"Request miss ratio: {req_miss_ratio:.4f}, Byte miss ratio: {byte_miss_ratio:.4f}")
7777

7878
# Step 3.1: Further process the first 1000 requests again
79-
req_miss_ratio, byte_miss_ratio = cache.process_trace(
80-
reader,
81-
start_req=0,
82-
max_req=1000
79+
cache = lcs.S3FIFO(
80+
cache_size=1024 * 1024,
81+
# Cache specific parameters
82+
small_size_ratio=0.2,
83+
ghost_size_ratio=0.8,
84+
move_to_main_threshold=2,
8385
)
86+
req_miss_ratio, byte_miss_ratio = cache.process_trace(reader, start_req=0, max_req=1000)
8487
print(f"Request miss ratio: {req_miss_ratio:.4f}, Byte miss ratio: {byte_miss_ratio:.4f}")
8588
```
8689

docs/src/en/getting_started/quickstart.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ With libcachesim installed, you can start cache simulation for some eviction alg
7878
print(f"Request miss ratio: {req_miss_ratio:.4f}, Byte miss ratio: {byte_miss_ratio:.4f}")
7979

8080
# Step 3.1: Further process the first 1000 requests again
81-
req_miss_ratio, byte_miss_ratio = cache.process_trace(
82-
reader,
83-
start_req=0,
84-
max_req=1000
81+
cache = lcs.S3FIFO(
82+
cache_size=1024 * 1024,
83+
# Cache specific parameters
84+
small_size_ratio=0.2,
85+
ghost_size_ratio=0.8,
86+
move_to_main_threshold=2,
8587
)
88+
req_miss_ratio, byte_miss_ratio = cache.process_trace(reader, start_req=0, max_req=1000)
8689
print(f"Request miss ratio: {req_miss_ratio:.4f}, Byte miss ratio: {byte_miss_ratio:.4f}")
8790
```
8891

libcachesim/_s3_cache.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
import hashlib
65
import logging
76
import os
87
import re

0 commit comments

Comments
 (0)