A few more process tweaks

- Removes unused btime globals.
- Removes unnecessary multiplication.
- Makes the garbage collector run twice as often, but do half as much
work.
- Makes the garbage collector SCHECK more often when performing hard
deletions.
- Adds a delay to the garbage collector's start.
This commit is contained in:
Krausus
2015-08-08 19:31:13 -04:00
parent 61edb3eb95
commit a00f9bbc64
4 changed files with 7 additions and 7 deletions
-3
View File
@@ -2,9 +2,6 @@
#define PRECISE_TIMER_AVAILABLE
#ifdef PRECISE_TIMER_AVAILABLE
var/global/__btime__lastTimeOfHour = 0
var/global/__btime__callCount = 0
var/global/__btime__lastTick = 0
var/global/__btime__libName = "btime.[world.system_type==MS_WINDOWS?"dll":"so"]"
#define TimeOfHour (__extern__timeofhour)
#define __extern__timeofhour text2num(call(__btime__libName, "gettime")())
@@ -206,7 +206,7 @@
CRASH("Process [name] hung and was restarted.")
if (main.getCurrentTickElapsedTime() > main.timeAllowance)
sleep(world.tick_lag*1)
sleep(world.tick_lag)
cpu_defer_count++
last_slept = TimeOfHour
else
+2 -1
View File
@@ -1,6 +1,7 @@
/datum/controller/process/garbage_collector/setup()
name = "garbage"
schedule_interval = 20 // every 2 seconds
schedule_interval = 10
start_delay = 3
garbageCollector = src
@@ -2,9 +2,9 @@
// For general information about how the GC works and how to use it, see __gc_info.dm
#define GC_COLLECTIONS_PER_TICK 300 // Was 100.
#define GC_COLLECTIONS_PER_TICK 150 // Was 100.
#define GC_COLLECTION_TIMEOUT (30 SECONDS)
#define GC_FORCE_DEL_PER_TICK 60
#define GC_FORCE_DEL_PER_TICK 30
//#define GC_DEBUG
// A list of types that were queued in the GC, and had to be soft deleted; used in testing
@@ -60,6 +60,8 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
queue.Cut(1, 2)
remainingForceDelPerTick--
// Sleep check more aggressively when force deleting.
calls_since_last_scheck += 9
else // Otherwise, it was GC'd - remove it from the queue
queue.Cut(1, 2)
soft_dels++