Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: post on react performance techniques #255

Closed
chrisvaillancourt opened this issue Jan 29, 2025 · 3 comments · Fixed by #260
Closed

feat: post on react performance techniques #255

chrisvaillancourt opened this issue Jan 29, 2025 · 3 comments · Fixed by #260
Assignees
Labels
enhancement New feature or request

Comments

@chrisvaillancourt
Copy link
Owner

Briefly discuss approaches to performance optimization in react

App architecture

Optimizing re-renders

  • component memoization
  • react compiler
  • useMemo
  • useCallback
  • don't define functions / objects in the render body of a function
    • don't define event handlers directly in line with the component
  • remove anything that will change between renders i.e. new Date()
  • don't chain effects off state (i.e. calculate derived state in the function's render)
  • useTransition() and useDeferredValue() to defer UI updates

Profiling

Reimplementations

@chrisvaillancourt chrisvaillancourt added the enhancement New feature or request label Jan 29, 2025
@chrisvaillancourt chrisvaillancourt self-assigned this Jan 29, 2025
@chrisvaillancourt
Copy link
Owner Author

Refer to obsidian notes on react performance.

@chrisvaillancourt
Copy link
Owner Author

Add links to a few popular videos on react performance.

If the vast majority of react apps are slow then maybe react is the problem? React doesn't seem to scale well without a lot of engineering effort.

https://emnudge.dev/blog/react-hostage/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant