Skip to content

Perf issues on complex component #654

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

Closed
Jsalies opened this issue Apr 26, 2019 · 2 comments
Closed

Perf issues on complex component #654

Jsalies opened this issue Apr 26, 2019 · 2 comments

Comments

@Jsalies
Copy link

Jsalies commented Apr 26, 2019

🤓 Question

First of all, I must say that I am amazed by what react spring can do. It is easy to use, easy to understand.

Here is my issue / questionning:
I am currently working on a react / react-spring calendar. I am trying to animate each day in a calendar. To do so, I used "Transition" on each day. Unfortunately, I am encountering a huge performance issue each time that I change the month / year.

On firefox, each time I change the targeted month, fps go down to 5 fps during the whole animation.

here is a simple sandbox of my project : here

My questions 👍

  • is animating 42 elements in same time to much?
  • how could we do to optimize performances? (change from Transition to another animation component?)
  • perhaps I just don't get the way to think components with react-spring so should I rethink my component in another way?

Thank you for your time.

@epolderman
Copy link

epolderman commented Apr 28, 2019

Usually when writing a date selector component, or at least in my experience, it needs virtualization, no matter how optimized the animation library is.
https://github.com/bvaughn/react-window

FF does have a different rendering engine than Chrome as well, which is Gecko.
You could profile your application and see that which part of the pixel pipeline is eating up most of your frame. Is it the JS? Style Recalc? Layout? Paint? Composite? Determining which layer is eating most of your frame will narrow down your investigation a bit.

https://developers.google.com/web/fundamentals/performance/rendering/

@Jsalies
Copy link
Author

Jsalies commented May 2, 2019

Thank you, I never thought about something like virtualization or layer optimization. I will start to look deeper into these topics and try to optimize my work.

@Jsalies Jsalies closed this as completed May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants