mem100x
Version:
⚡ The FASTEST MCP memory server ever built - 66k+ entities/sec with intelligent context detection
37 lines • 1.04 kB
TypeScript
/**
* Memory-efficient Radix Tree (Compressed Trie) Cache implementation
* Optimized for string keys with shared prefixes (like entity names)
* Provides O(k) lookup where k is key length, with minimal memory overhead
*/
export declare class RadixTreeCache<V> {
private root;
private size;
private readonly maxSize;
private accessOrder;
private accessCounter;
private hits;
private misses;
constructor(maxSize?: number);
private createNode;
get(key: string): V | undefined;
set(key: string, value: V): void;
private insert;
private findNode;
private getCommonPrefix;
has(key: string): boolean;
delete(key: string): boolean;
private evictLRU;
clear(): void;
getStats(): {
hits: number;
misses: number;
hitRate: number;
size: number;
memoryInfo: any;
};
private countNodes;
private getAverageEdgeLength;
private getMaxDepth;
estimateMemoryUsage(): number;
}
//# sourceMappingURL=radix-tree-cache.d.ts.map