# Themes Drastically slowing down Screen/Component Generation

**URL:** <http://forum.squareline.io/t/themes-drastically-slowing-down-screen-component-generation/2682>\
**Category:** Bugs\
**Created:** [March 14, 2024, 7:30pm UTC](http://forum.squareline.io/t/themes-drastically-slowing-down-screen-component-generation/2682 "2024-03-14T19:30:04Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Hermit](http://forum.squareline.io/user_avatar/forum.squareline.io/hermit/32/971_2.png) [@Hermit](http://forum.squareline.io/u/Hermit)\
**Post date:** [November 16, 2024, 10:30pm UTC](http://forum.squareline.io/t/themes-drastically-slowing-down-screen-component-generation/2682/11 "2024-11-16T22:30:19Z")

</div>

The LVGL-discussion which the other topic ( [Not use the lv\_obj\_is\_valid() in ui\_theme\_manager.c](https://forum.squareline.io/t/not-use-the-lv-obj-is-valid-in-ui-theme-manager-c/3618) ) mentions was closed without an improvement for lv\_obj\_is\_valid, as I see in LVGL-9.2 source-code. So lv\_obj\_is\_valid can/should really be removed where it isn’t really necessary. I think it can be removed at least from ui\_object\_set\_themeable\_style\_property() because SLS (and hopefully the user-code) won’t call this function on a non-existing widget. However, it can’t inevitably be removed from the ui\_object\_set\_local\_style\_property() which the theme-changer code uses because theme changer shouldn’t set a local style on a widget that doesn’t exist, and garbage-collector is not guaranteed to have deleted every non-existent widget’s style-registry at the time of theme-switching. But anyway, boot-time of the GUI can still be made faster by removing the former, and only the on-the-fly theme change (when switching theme from the application) will take the really necessary time it needs.  
It also seems that with big projects the explicit garbage collection’s period of 100 makes significant boot-time improvement, it’s preferable from now as a default value.

---

_[View the full topic](http://forum.squareline.io/t/themes-drastically-slowing-down-screen-component-generation/2682)._
