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

Effect on Performance #71

Open
gfyre opened this issue Jan 18, 2022 · 4 comments
Open

Effect on Performance #71

gfyre opened this issue Jan 18, 2022 · 4 comments

Comments

@gfyre
Copy link

gfyre commented Jan 18, 2022

Hey guys! I just discovered Styled_Widgets and I'd like to say Kudos! for building such a wonderful library.

I have 2, rather simple questions.

  1. Would using this package have any effect on the performance of the app, assuming that it is a graphically intensive application?
  2. Can I use this to build a desktop app? (I am assuming that I can because of how flutter compiles Dart code to desktop bundles)

Thanks!

@gfyre gfyre changed the title Performance Issues Effect on Performance Jan 18, 2022
@ReinBentdal
Copy link
Owner

Hello!
I have not done any specific tests to check how the package effects performance. However in my personal experience building apps, the performance has always been good. Since the library only generates widget trees there shouldn't be a big hit on performance. However someone has to measure this to verify.

It should work perfectly fine on desktop as well. There might be some missing widgets which is not implemented. It is easy to extend this library. Just make a pull request for new widgets and I will probably accept!

@alguintu
Copy link

Does this package lose the benefits of the const tables for widgets? E.g.:

Padding(
   padding: const EdgeInsets.all(8)
);

According to flutter/dart docs, all const widgets are built into a table on compile time, and then looked up on rendering to ensure they never get rebuilt needlessly.

Just wonder how this library affects rebuild count and framerates on fairly complex widget trees.

@daniloapr
Copy link

I have this same concern. As far as I know, it's based on extensions, which is similar to having helper functions returning Widgets and this is not recommended by the Flutter team (video on Youtube). Is that right?

For smaller apps it won't be a problem. My concern is how does it scale.

@ReinBentdal
Copy link
Owner

I don't think the issue they discussed in the video is exactly applicable. It's about unnecessary rebuilds of features, which is solved by isolating features in widgets. Flutter will then only rebuild widgets where the parameters has changed. But the widgets may use styled_widget. That being said, again, it has to be measured and tested to see the actual impact of styled_widget

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

4 participants