S
S
sergealmazov2018-09-06 10:47:06
Client side optimization
sergealmazov, 2018-09-06 10:47:06

How do you solve React/Redux performance issues?

Good afternoon!
I ran into a problem - the React / Redux application began to slow down. Began to understand. Someone advises to finalize shoudComponentUpdate, someone not to use arrow functions in the render method.
I have a question for the community. And how do you personally optimize the performance of your application? What is bad to use in React / Redux - architecture, and what, on the contrary, is good?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2018-09-06
@sergealmazov

As you correctly suggested in the comment - you need to profile.
To do this, boot with the developer panel, click Profile and see where you have problems.
Also, an easy way to get started is to add console.logcomponents to the render and see if there are any extra redraws. Of course, you don’t need to add it everywhere at once, but you can gradually cover it (either a feature, or a page, or just something that seems large and resource-intensive).
Using shouldComponentUpdate is one of the most common and powerful ways.
On the subject: the React / Redux application began to slow down- add more specifics, it will be seen. Everything is individual, but usually the simplest advice is to use SCU, split into small components, split data for reducers (do not store everything in one large one), use selectors, minimize difficult calculations (maybe you have somewhere a corny "heavy" function all the time recalculates the result, but this is not necessary)
ps good article on EN - https://medium.com/@alexandereardon/dragging-react...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question