Lighting performance/profiling tweaks

- Lighting process now yields at 10% of a tick and defers at 80% of a
tick
- There is no longer a limit to how many sources/corners/overlays will
update in a single work run
- Source/corner/overlay totals are now simple counts instead of lists
- Lighting update stats now show updates over each of the previous 5
seconds
- Space turfs now remove their starlight when changing to a different
turf, fixing a runtime
This commit is contained in:
Krausus
2017-02-19 23:37:54 -05:00
parent 298874e1ba
commit 471d1d9c98
5 changed files with 43 additions and 46 deletions

View File

@@ -1,4 +1,4 @@
/var/list/datum/light_source/all_lighting_sources = list()
/var/total_lighting_sources = 0
// This is where the fun begins.
// These are the main datums that emit light.
@@ -32,7 +32,7 @@
var/force_update
/datum/light_source/New(var/atom/owner, var/atom/top)
all_lighting_sources += src
total_lighting_sources++
source_atom = owner // Set our new owner.
if(!source_atom.light_sources)
source_atom.light_sources = list()
@@ -62,7 +62,7 @@
// Kill ourselves.
/datum/light_source/proc/destroy()
all_lighting_sources -= src
total_lighting_sources--
destroyed = TRUE
force_update()
if(source_atom)