mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
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:
@@ -19,7 +19,7 @@
|
||||
//Or if we're on station. Otherwise, die.
|
||||
var/list/allowed_areas = GLOB.the_station_areas + typesof(/area/mine)
|
||||
alert_control = new(computer, list(ALARM_ATMOS, ALARM_FIRE, ALARM_POWER), listener_areas = allowed_areas)
|
||||
RegisterSignal(alert_control.listener, list(COMSIG_ALARM_LISTENER_TRIGGERED, COMSIG_ALARM_LISTENER_CLEARED), PROC_REF(update_alarm_display))
|
||||
RegisterSignals(alert_control.listener, list(COMSIG_ALARM_LISTENER_TRIGGERED, COMSIG_ALARM_LISTENER_CLEARED), PROC_REF(update_alarm_display))
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/alarm_monitor/Destroy()
|
||||
|
||||
Reference in New Issue
Block a user