Add performance logging and reduce re-renders - #23
Merged
Conversation
This PR adds comprehensive performance logging to identify bottlenecks in popup load time and fixes excessive re-renders in the Router component. ## Changes ### Performance Logging - Add startup time logging in index.tsx - Log imports and initialization completion - Log React render start time - Log when App component mounts - Log when FullApp component mounts - Log when user is unlocked - Log when Unlocked component is shown - Log when first paint completes - Store global __APP_START_TIME__ for consistent measurements ### Performance Optimizations - Fix excessive re-renders in Router component (was rendering 10+ times) - Move "Showing Unlocked component" log to useEffect with useRef guard - Prevents duplicate logging on each re-render ## Performance Metrics Current measurements show: - JavaScript bundle load: 224ms - Total time to first paint: ~682ms - Multiple re-renders identified and fixed ## Impact This enables developers to: - Identify exact bottlenecks during popup load - Measure impact of optimizations - Track performance regressions Next steps for optimization: - Bundle size analysis with webpack-bundle-analyzer - Code splitting for vendor bundles - Reduce Recoil atom cascade re-renders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive performance logging to identify bottlenecks in popup load time and fixes excessive re-renders in the Router component.
Changes
Performance Logging
__APP_START_TIME__for consistent measurements across componentsPerformance Optimizations
Performance Metrics
Current measurements show:
Identified Bottlenecks:
Files Changed
packages/app-extension/src/index.tsx- Add startup and initialization loggingpackages/app-extension/src/app/App.tsx- Add component mount and first paint loggingpackages/app-extension/src/app/Router.tsx- Fix re-renders, add useRef guard for loggingImpact
This enables developers to:
Next Steps for Optimization
To reach target of <300ms:
Test Plan