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 when rendering many components #256

Open
mattikl opened this issue Feb 6, 2016 · 2 comments
Open

Performance when rendering many components #256

mattikl opened this issue Feb 6, 2016 · 2 comments

Comments

@mattikl
Copy link

mattikl commented Feb 6, 2016

I'm rendering a list that contains Toggle and TextInput components. When this list gets long, the initial render is super slow. Also the subsequent renders of the list are slow, but I can solve this problem in application code by wrapping the Belle components and implementing shouldComponentUpdate.

I did some profiling and noticed that lots of CPU time gets consumed in functions injectStyles and removeStyle. It looks like the performance could be improved by refactoring how the style storage is used and styles updated. I'm thinking immutable data structures and batching the updates. But this is just guessing since I don't know the code well.

Is anyone working on this already? Any thoughts?

I also understand that the main objective in Belle is good UX and the performance optimizations shouldn't interfere with that. Optimal solution for the long list use case would be to use components that only implemented the needed functionality and focus on performance. But I've been happy using Belle so far, so thanks for the great work with it!

@nikgraf
Copy link
Owner

nikgraf commented Feb 9, 2016

Hey @mattikl, thanks for your kind words & the feedback. Super valuable. Especially that you already did some profiling.

Yes, I'm working on a solution, but it will more be a complete restructuring of the architecture of Belle (using CSS Modules by default, but you can use anything class based). Here is what we came up so far: https://github.com/nikgraf/future-react-ui/ - I'm curious what you think about such a hard cut …

Right now I'm fixing a few bugs and upgrade Belle 2 to the lastest dependencies to do a final release for Belle 2 before focusing on Belle 3.

@mattikl
Copy link
Author

mattikl commented Feb 10, 2016

Hi @nikgraf, that's all very interesting. I haven't seen enough real-life usage to really compare the different techniques, but that's sounds like a good approach for Belle 3.

So rather than trying to optimize Belle 2's ad hoc styling, I'll wait for Belle 3 development to start and hope to help you out with that.

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