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

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Zomis
Inserter
Inserter
Posts: 31
Joined: Fri Apr 21, 2017 7:01 pm
Contact:

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

Post 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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding discussion”