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

Performance degradation in antd with cssinjs compared to v4 #199

Open
pbrzosko opened this issue Oct 14, 2024 · 3 comments
Open

Performance degradation in antd with cssinjs compared to v4 #199

pbrzosko opened this issue Oct 14, 2024 · 3 comments
Assignees

Comments

@pbrzosko
Copy link

Hi,

we are getting a quite significant performance degradation in our virtual scrolled component with a lot of Antd components inside. Below are screeenshots of FF profiler with cssinjs (antd v5) and without (antd v4). It seems like the bottleneck here is the useToken -> useCacheToken -> useGlobalCache code. In Chrome it seems updateCSS to be the issue.

  1. Can you give more details, why CSS needs to be updated when we are scrolling virtual container? It seems to me that could be avoided, as nothing is changed with the component - it is just mounted / unmounted?
  2. Can you give some hints about how to improve the performance. For now our component is not usable.

Ant5 - see the red Jank stripes
image

Ant4
image

@pbrzosko
Copy link
Author

Also we use one theme instance and everything is constant in it - I think those component styles should be generated once and added to the page and that's it.
Why it has to be constantly updated? What is being changed there?

Also, we tried extracting styles to a file as described here: https://ant.design/docs/react/server-side-rendering, but this didn't help.

@pbrzosko
Copy link
Author

Any progress on this one?

@saneksa
Copy link

saneksa commented Dec 6, 2024

@pbrzosko We've been having the same problem

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

3 participants