Page MenuHomeWildfire Games

The gui shouldn't load again needed templates on each turn
ClosedPublic

Authored by mimo on Jan 26 2018, 6:50 PM.

Details

Summary

As templates values may change (with techs or auras), templates are reloaded each turn by the gui. As new techs or auras are not so frequent, that's not necessary and quite time consuming as even with only one unit selected, all templates in its productionQueue have also to be loaded again.
The patch only reload them when something has changed.

Test Plan

Check that nothing is broken in the gui

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mimo created this revision.Jan 26 2018, 6:50 PM
Owners added a subscriber: Restricted Owners Package.Jan 26 2018, 6:50 PM

funny coincidence, I was just working on the exact same thing ^^

My approach is a bit different though, wouldn't it be possible to only reload all the changed templates and not all templates of a player if something changed?

(also, are you planning more of these gui sim update performance related changes? I want to avoid that we do double work and am currently (and have been for a while) trying to improve the performance of selection gui updates)

mimo added a comment.Jan 26 2018, 6:59 PM

funny coincidence, I was just working on the exact same thing ^^

but as gui time is a real concern, that's not so unexpected. And that's good for a good (and fast) review that you already looked at this problem :-)

mimo added a comment.Jan 26 2018, 7:02 PM

My approach is a bit different though, wouldn't it be possible to only reload all the changed templates and not all templates of a player if something changed?

I think that is the case in the patch: templates are reloaded only when needed (not all of them).

mimo added a comment.Jan 26 2018, 7:03 PM

(also, are you planning more of these gui sim update performance related changes? I want to avoid that we do double work and am currently (and have been for a while) trying to improve the performance of selection gui updates)

I didn't know you were still working on it. If you do, that's fine, i'll won't continue (nothing else in my current plans about it).

Ok, at least I will review this patch (I think it's fine, but I will need to get svn to apply the patch as it doesn't seem to apply on the latest state of the git mirrors, so will need about 30 minutes before I can test it).
Only thing I can think of is that maybe templateDataStatus could be renamed to modifiedTemplates, GetTemplateDataStatus to IsTemplateModified, but am not sure if that would be an improvement.

mimo added inline comments.Jan 26 2018, 7:29 PM
binaries/data/mods/public/gui/session/session.js
488 ↗(On Diff #5506)

leftover argument from a previous version of the patch, will be removed.

echotangoecho accepted this revision.Jan 26 2018, 7:38 PM

Seems to work well.

This revision is now accepted and ready to land.Jan 26 2018, 7:38 PM
This revision was automatically updated to reflect the committed changes.
mimo added a comment.Jan 26 2018, 8:11 PM

Thanks for the fast review