Save 0.6-0.7s of init time by splitting registering lists of signals into its own proc, and optimizing QDELETED (#71056)

- Makes QDELETED use isnull(x) instead of !x, giving about 0.2 to 0.25s
of speed.
- Make disposal constructs only update icon state rather than go through
expensive overlay code. Unfortunately did not have much effect, but is
something they should've been doing nonetheless.
- Makes RegisterSignal only take signals directly as opposed to
allocating a fresh list of signals. Very few consumers actually used
this and it costs about 0.4s. Also I think this is just a bad API anyway
and that separate procs are important

`\bRegisterSignal\((.*)list\(` replaced with `RegisterSignals($1list(`
This commit is contained in:
Mothblocks
2022-11-22 07:40:05 +00:00
committed by GitHub
parent 1617db4efa
commit fa7688d043
79 changed files with 140 additions and 131 deletions
+1 -1
View File
@@ -156,7 +156,7 @@
. = ..()
if(istype(shell, /obj/machinery/door/airlock))
attached_airlock = shell
RegisterSignal(shell, list(
RegisterSignals(shell, list(
COMSIG_OBJ_ALLOWED,
COMSIG_AIRLOCK_SHELL_ALLOWED,
), PROC_REF(handle_allowed))
+1 -1
View File
@@ -34,7 +34,7 @@
signal = add_output_port("Signal", PORT_TYPE_SIGNAL)
/obj/item/circuit_component/assembly_input/register_shell(atom/movable/shell)
RegisterSignal(shell, list(COMSIG_ASSEMBLY_PULSED, COMSIG_ITEM_ATTACK_SELF), PROC_REF(on_pulsed))
RegisterSignals(shell, list(COMSIG_ASSEMBLY_PULSED, COMSIG_ITEM_ATTACK_SELF), PROC_REF(on_pulsed))
/obj/item/circuit_component/assembly_input/unregister_shell(atom/movable/shell)
UnregisterSignal(shell, list(COMSIG_ASSEMBLY_PULSED, COMSIG_ITEM_ATTACK_SELF))
+1 -1
View File
@@ -164,7 +164,7 @@
var/obj/item/circuit_component/vendor_component/vendor_component = new(parent)
parent.add_component(vendor_component, user)
vendor_components += vendor_component
RegisterSignal(vendor_component, list(
RegisterSignals(vendor_component, list(
COMSIG_PARENT_QDELETING,
COMSIG_CIRCUIT_COMPONENT_REMOVED,
), PROC_REF(remove_vendor_component))