incremental-everything
incremental-everything copied to clipboard
refactor: use cache for incremental rem powerup checks
Summary
- Replaces expensive
hasPowerup()API calls with cache-based lookups across all widgets and components - Adds new cache utility functions for checking incremental rem status
- Updates cache automatically when SRS data is modified
Changes
- Added
isIncrementalRem()andgetIncrementalRemFromCache()utility functions - Replaced
rem.hasPowerup(powerupCode)calls with cache lookups throughout codebase - Replaced
powerup.taggedRem()withgetAllIncrementalRemsFromCache()for better performance - Modified
updateSRSDataForRem()to automatically update cache after changes - Removed redundant manual cache updates in editor review widgets
Performance Impact
This change significantly reduces API calls when checking if rems have the incremental powerup, improving overall plugin performance especially in widgets that process multiple rems.
@randygrok I haven't reviewed the code yet, but just came to my mind the concern that changing API calls by cache-based lookups can have impact in the Light Mode. Do you think these functions will work fine in the Light Mode as well? Don't we need something like a fallback in case Light Mode is in use?