/** * @holoscript/core Runtime Optimization * * Object pooling, lazy evaluation, memoization, caching */ /** * Generic object pool for efficient memory reuse */ export declare class ObjectPool { private factory; private reset; private _capacity; private available; private inUse; private peakUsage; constructor(factory: () => T, reset: (obj: T) => void, _capacity?: number); /** * Pre-allocate objects */ private preallocate; /** * Acquire object from pool */ acquire(): T; /** * Release object back to pool */ release(obj: T): void; /** * Batch acquire */ acquireBatch(count: number): T[]; /** * Batch release */ releaseBatch(objects: T[]): void; /** * Get pool statistics */ getStats(): { available: number; inUse: number; peakUsage: number; utilization: number; }; /** * Clear pool */ clear(): void; } /** * Lazy evaluated value */ export declare class Lazy { private compute; private value; private computed; constructor(compute: () => T); /** * Get value (compute if needed) */ get(): T; /** * Force re-computation */ reset(): void; /** * Check if computed */ isComputed(): boolean; } /** * Memoization decorator */ export declare function memoize any>(fn: T, maxSize?: number): T; /** * Memoized property decorator */ export declare function MemoizedProperty(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * Method memoization decorator */ export declare function MethodMemoize(maxSize?: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor; /** * LRU Cache with maximum size */ export declare class LRUCache { private maxSize; private cache; private accessOrder; constructor(maxSize?: number); /** * Get value from cache */ get(key: K): V | undefined; /** * Set value in cache */ set(key: K, value: V): void; /** * Clear cache */ clear(): void; /** * Get cache stats */ getStats(): { size: number; maxSize: number; utilization: number; }; } /** * Batch processing for efficient bulk operations */ export declare class Batcher { private processor; private batchSize; private flushIntervalMs; private queue; private processingTimeout; constructor(processor: (batch: T[]) => Promise, batchSize?: number, flushIntervalMs?: number); /** * Add item to batch */ add(item: T): Promise; /** * Flush batch */ private flush; /** * Manually flush remaining items */ flushAll(): Promise; } /** * Performance profiler with hot path tracking */ export declare class PerformanceProfiler { private measurements; private activeTimers; /** * Start timing a function */ startTimer(label: string): void; /** * End timing */ endTimer(label: string): number; /** * Measure function execution */ measure(label: string, fn: () => Promise): Promise; /** * Get profiling report */ getReport(): string; /** * Reset measurements */ reset(): void; /** * Get hottest paths */ getHotPaths(topN?: number): Array<[string, number]>; } export declare function getGlobalProfiler(): PerformanceProfiler; //# sourceMappingURL=RuntimeOptimization.d.ts.map