Skip to content

Conversation

@OmarBERRABEH
Copy link
Contributor

✨ Title

[FEATURE]: Add comprehensive React performance best practices and guidelines

📄 Description

This PR adds comprehensive documentation on React performance best practices to the React section of our gems repository. It addresses issue #17 by providing detailed guidance on:

  1. Memoization usage guidelines - Clear criteria for when to use and when not to use React.memo, useMemo, and useCallback with practical examples of both good and bad implementations
  2. Detailed profiling instructions - Step-by-step guide for using React DevTools Profiler, Lighthouse, and the Profiler API to identify performance bottlenecks
  3. React Compiler insights - In-depth explanation of how the upcoming React Compiler works and how teams can prepare for it
  4. Performance debugging techniques - Practical approaches to diagnosing and fixing common React performance issues

These additions will help Ekino engineers make more informed decisions about performance optimization, leading to more efficient and maintainable React applications.

✅ Checklist

I have read and followed the Contribution Guide.

🔗 Contextual Links (optional)

📸 Visuals (optional)

N/A - Documentation changes only

🔍 Reviewers

Please assign the React team lead as a reviewer for this PR. The PR cannot be merged until it is approved by the reviewer.


### When NOT to Use Performance Optimizations

Performance optimizations come with costs like increased code complexity and maintainability challenges. Here are situations when you should avoid unnecessary optimizations:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also highlight the fact it can make even worse from a memory perspective. Like this quote from Kent C. Dodds

Performance optimizations are not free. They ALWAYS come with a cost but do NOT always come with a benefit to offset that cost.

I think we should also put a link to this famous article from him When to useMemo and useCallback

And add to the React compiler section that we no longer need to use useMemo and useCallback if the compiler is activated.

@padupuy
Copy link
Contributor

padupuy commented Jun 23, 2025

Thank you for this detailed PR on React performance best practices @OmarBERRABEH !

I’d like to suggest not to duplicate best practices that are already well documented on the official React website, such as in the “Learn” section (https://react.dev/learn).
The purpose of the GEMS repo is to highlight recommendations and specific feedback from Ekino developers, rather than copying guides that are already widely available.

To go further, it would be relevant to:

  • Highlight patterns and tips specific to our Ekino projects
  • Add concrete examples based on our real-world experience
  • Reference official resources for points already well covered by React

What do you think? This would make the documentation even more useful and targeted for our team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: React Performance

3 participants