Page 1 of 1

GUIs - is there a performance impact of destroying and recreating?

Posted: Thu Jul 30, 2020 4:34 pm
by Zomis
First off, I'm a big fan of the JavaScript framework Vue.js and I find GUIs to be the most frustrating part about Factorio modding.

Naturally, for those of you who are familiar with Vue.js, I don't really expect Factorio to provide similar functionality.

But I am however wondering how big the performance impact is in Factorio if a GUI is destroyed and recreated within the same tick (to basically do a "complete refresh" of the GUI). Is the game engine smart enough to only update the affected elements or will there be a big performance penalty for destroying and recreating GUI elements and potentially huge complex nested GUIs?

Re: GUIs - is there a performance impact of destroying and recreating?

Posted: Fri Jul 31, 2020 3:41 pm
by Rseding91
Destroying and recreating a GUI will do just that; there's no logic to say "well this one was close to the last; so re-use stuff" - it just destroys and re-creates.

If you want to refresh; just refresh. Anything you can set during creation you can set after creation by just assigning.