Opened 3 years ago
Last modified 2 years ago
#5979 new enhancement
Don't initialise null/boolean values in components. — at Version 4
Reported by: | Freagarach | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Simulation | Keywords: | simple |
Cc: | Patch: | Phab:D3468 |
Description (last modified by )
In many JS components there are a lot of variables created on init that are not strictly necessary.
E.g. in ResourceGatherer
: this.lastCarriedType = undefined;
.
There are more such examples of which some can have more effect on performance. It would be good to not initialise such values, but create them when needed and delete them when not needed anymore. This saves time on init and serialisation data during a game. (Refs. #3834.)
Also booleans are a good example of variables that need not to be initialised.
Change History (4)
comment:1 by , 3 years ago
Patch: | → Phab:D3468 |
---|
comment:2 by , 3 years ago
comment:4 by , 3 years ago
Description: | modified (diff) |
---|---|
Summary: | Don't initialise null values in components. → Don't initialise null/boolean values in components. |
Note:
See TracTickets
for help on using tickets.
In r24993:
Do not initialise null values in cmpGarrisonHolder.
Saves some serialisation data (refs #3834).
Ticket: #5979
Differential revision: Phab:D3468
Comments by: @Angen, @Stan