Eviction Seive Algorithm

This commit is contained in:
isha28-uclaCS
2025-02-17 20:21:08 -08:00
parent 44dbf976b5
commit 8328c6e610
3 changed files with 126 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ from database import get_user_profile, update_user_profile
from cache.cache import BaselineCache
from cache.prefetch_cache import PrefetchCache
from cache.tiered_cache import TieredCache
from cache.eviction_seive import SeiveCache
from config import CACHE_STRATEGY, CACHE_LIMIT, L2_CACHE_LIMIT
import time
@@ -15,6 +16,8 @@ elif CACHE_STRATEGY == "Prefetch":
cache = PrefetchCache()
elif CACHE_STRATEGY == "Tiered":
cache = TieredCache(limit=CACHE_LIMIT, l2_limit=L2_CACHE_LIMIT)
elif CACHE_STRATEGY == "Seive":
cache = SeiveCache(limit=CACHE_LIMIT)
else:
raise ValueError(f"Invalid CACHE_STRATEGY: {CACHE_STRATEGY}")