mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user