ENG-1579: Fix plugin init performance#915
Conversation
…paths Cache isNewSettingsStoreEnabled(), getFeatureFlags(), getGlobalSettings(), getPersonalSettings(), and all legacy setting readers to avoid redundant Roam DB queries during init. Cache getDiscourseNodes/Relations and fix findDiscourseNode default param that evaluated getDiscourseNodes() before cache check. Add console.time instrumentation for ongoing diagnostics. Init: 27s → 1.1s on megacoglab. Settings panel: 17s → 11ms.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
…ersion-based invalidation - Remove all console.time instrumentation, replace with single performance.now() total init log - Rename _underscore cache variables to camelCase (drop eslint-disable) - Add configCacheVersion module for cross-module cache staleness without circular imports - Remove redundant invalidateNewSettingsStoreCache (shared watcher path already handles it) - Add TODO(ENG-1471) on legacy dual-read caches - Rename render → openSettingsDialog, measure settings open time via requestAnimationFrame
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughThe PR introduces a caching infrastructure for settings and discourse graph structures, with cache invalidation integrated into settings initialization, pull-watch updates, and full config refresh. Performance timing is added to track dialog opening and overall extension startup duration. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The regression was caused by repeated dual-read validation work during startup, not
by block props themselves; we cached that path and fixed invalidation, which brought
init from ~20s down to ~1.15s. This is the right migration-phase fix, and the long-
term cleanup is to delete dual-read entirely.
Summary by CodeRabbit
Release Notes
Refactor
Chores