snowflake-sql-validator
Version:
Snowflake SQL validator for React applications
49 lines • 1.48 kB
TypeScript
/**
* Performance optimization utilities for the Snowflake SQL Validator
*/
export declare class PerformanceOptimizer {
private static lruCache;
private static readonly MAX_CACHE_SIZE;
private static readonly CACHE_ACCESS_COUNT;
/**
* Get cached value with LRU eviction
*/
static getCached<T>(key: string): T | undefined;
/**
* Set cached value with LRU eviction
*/
static setCached<T>(key: string, value: T): void;
/**
* Evict least recently used items from cache
*/
private static evictLRU;
/**
* Clear all caches
*/
static clearAllCaches(): void;
/**
* Get cache statistics
*/
static getCacheStats(): {
size: number;
maxSize: number;
hitRate: number;
};
/**
* Debounce function calls for performance
*/
static debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
/**
* Throttle function calls for performance
*/
static throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
/**
* Batch multiple operations for better performance
*/
static batch<T>(items: T[], batchSize: number, processor: (batch: T[]) => void): void;
/**
* Measure execution time of a function
*/
static measureTime<T>(fn: () => T, label: string): T;
}
//# sourceMappingURL=PerformanceOptimizer.d.ts.map