Tweaks some procs in garbage to make profiling it better (#26210)

Having soft delete overhead and queued hard delete overhead merging in the profile was confusing me.
This commit is contained in:
Kyle Spier-Swenson
2017-04-15 09:37:42 -07:00
committed by duncathan salt
parent 0f0d016fcf
commit d688553d4c

View File

@@ -113,7 +113,7 @@ SUBSYSTEM_DEF(garbage)
var/time = world.timeofday
var/tick = world.tick_usage
var/ticktime = world.time
del(A)
HardDelete(A)
tick = (world.tick_usage-tick+((world.time-ticktime)/world.tick_lag*100))
if (tick > highest_del_tickusage)
@@ -140,10 +140,10 @@ SUBSYSTEM_DEF(garbage)
A.gc_destroyed = GC_QUEUED_FOR_QUEUING
/datum/controller/subsystem/garbage/proc/Queue(datum/A)
if (!istype(A) || (!isnull(A.gc_destroyed) && A.gc_destroyed >= 0))
if (!isnull(A) || (!isnull(A.gc_destroyed) && A.gc_destroyed >= 0))
return
if (A.gc_destroyed == GC_QUEUED_FOR_HARD_DEL)
del(A)
HardDelete(A)
return
var/gctime = world.time
var/refid = "\ref[A]"
@@ -155,6 +155,10 @@ SUBSYSTEM_DEF(garbage)
queue[refid] = gctime
//this is purely to seperate things profile wise.
/datum/controller/subsystem/garbage/proc/HardDelete(datum/A)
del(A)
/datum/controller/subsystem/garbage/proc/HardQueue(datum/A)
if (istype(A) && A.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
tobequeued += A