incremental-everything icon indicating copy to clipboard operation
incremental-everything copied to clipboard

refactor: use cache for incremental rem powerup checks

Open randygrok opened this issue 1 month ago • 1 comments

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() and getIncrementalRemFromCache() utility functions
  • Replaced rem.hasPowerup(powerupCode) calls with cache lookups throughout codebase
  • Replaced powerup.taggedRem() with getAllIncrementalRemsFromCache() 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 avatar Nov 16 '25 19:11 randygrok

@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?

hugomarins avatar Nov 17 '25 14:11 hugomarins