API Reference
PerformanceOptimizer
API reference for the PerformanceOptimizer class.
import { PerformanceOptimizer } from '@forcecalendar/core';
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 | undefined | Cached value |
optimizeQuery | (key: string, fn: Function) => any | Query result |
Cache types: 'event', 'query', 'dateRange'.
| Method | Signature | Returns |
|---|
measure | (operation: string, fn: Function) => any | Function result |
measureAsync | (operation: string, fn: Function) => Promise<any> | Function result |
getMetrics | () => object | All 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) => any | Result |
| Method | Signature | Returns |
|---|
destroy | () => void | — |