API Reference
PerformanceOptimizer API reference for the PerformanceOptimizer class.
Internal utility. PerformanceOptimizer is not exported from the @forcecalendar/core package entry point and cannot be imported directly. It is used internally by EventStore and EnhancedCalendar — access its output through APIs such as calendar.eventStore.getPerformanceMetrics() or EnhancedCalendar's performance methods.
new PerformanceOptimizer (options ?: {
eventCacheSize?: number, // default 500
queryCacheSize?: number, // default 100
dateRangeCacheSize?: number // default 50
})
Method Signature Returns cache(key: string, value: any, type?: string) => void— getFromCache(key: string, type?: string) => any | undefinedCached value optimizeQuery(key: string, fn: Function) => anyQuery result
Cache types: 'event', 'query', 'dateRange'.
Method Signature Returns measure(operation: string, fn: Function) => anyFunction result measureAsync(operation: string, fn: Function) => Promise<any>Function result getMetrics() => objectAll metrics
Method Signature Returns shouldUseLazyIndexing(event: Event) => boolean— createLazyIndexMarkers(event: Event) => void— expandLazyIndex(eventId: string, start: Date, end: Date) => void—
Method Signature Returns batch(operation: Function) => anyResult
Method Signature Returns destroy() => void—