Improving flet's import time by ~50% #4160
Closed
Kenshin9977
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I think we could consider migrating colors and icons to ENUMs. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While working on a project using flet I saw that any import made from flet took around 5 seconds. While investigating this I found out that 3 of those 5 seconds were used on
import icons
in flet_core/icons.py.The file defines ~8000 global variables in this fashion:
I tested removing all of those lines and it effectively more than halved the time it takes to import flet and consequently my app's launch time. Of course, removing all these values isn't an option but using an enum, a dict, a seperate JSON or even put those in several optional packages are ideas to radically improve flet's import time.
Beta Was this translation helpful? Give feedback.
All reactions