DarkRadiant: master c0889d6b
Author | Committer | Branch | Timestamp | Parent |
---|---|---|---|---|
orbweaver | orbweaver | master | 13.04.2022 19:20 | master 0b8498d5 |
Affected Issues | 0005935: Reload Defs takes longer every time | |||
Changeset | 0005935: fix progressive performance loss in "Reload Defs" When "Reload Defs" is invoked, the resolveInheritance() method is called again on entity classes, however the code in this method was not prepared for being called more than once, and set up a new sigc++ connection to the parent's changedSignal() each time. The resulting linearly-increasing number of connections gave rise to steadily worsening performance as the "Reload Defs" command was repeated, as entities redundantly responded to their parent's setColour/resetColour operation. We now store the sigc::connection in the EntityClass itself so that the previous connection can be disconnected before making a new one. As a further performance optimisation, the setColour() method only emits the changed signal if the colour actually changed, which massively reduces the number of unnecessary method calls. |
|||
mod - radiantcore/eclass/EntityClass.cpp | Diff File | |||
mod - radiantcore/eclass/EntityClass.h | Diff File |