Skip to content

Optimizations

Rob Nelson requested to merge pull/2330/powerfail into Bleeding-Edge

Created by: clusterfack

Calling area.power_change for all areas in world is the laggiest thing you can do. And it provides no benefit whatsoever as all machines themselves will check through machinery's process for a power update. Here is a lag comparison of how shit power_change is compared to letting process work its magic.

This is a profile of the power_failure() event without using power_change image

This is a profile if you force a power_change() update for all areas (as power_failure() does now) image

By the way removing it has quite literally no effect on the outcome, as process will depower every machine just like power_change without the lag. Also the power_failure() event is essentially playable now with this change, so perhaps it should be readded to the random events list.

Merge request reports