UNPKG

mem100x

Version:

⚡ The FASTEST MCP memory server ever built - 66k+ entities/sec with intelligent context detection

52 lines 1.27 kB
/** * Adaptive Replacement Cache (ARC) Implementation * * ARC dynamically balances between recency and frequency by maintaining: * - T1: Recent items seen once (LRU) * - T2: Recent items seen multiple times (LFU-like) * - B1: Ghost entries recently evicted from T1 * - B2: Ghost entries recently evicted from T2 * * The algorithm adapts the target size p for T1 based on workload. */ export declare class ARCCache<K, V> { private readonly c; private p; private t1; private t2; private b1; private b2; private hits; private misses; private adaptations; constructor(maxSize?: number); get(key: K): V | undefined; set(key: K, value: V): void; private replace; private maintainGhostLists; has(key: K): boolean; delete(key: K): boolean; clear(): void; getStats(): { hits: number; misses: number; hitRate: number; size: number; p: number; adaptations: number; distribution: { t1: number; t2: number; b1: number; b2: number; }; }; getState(): { t1: K[]; t2: K[]; b1: K[]; b2: K[]; p: number; }; } //# sourceMappingURL=arc-cache.d.ts.map