mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Now you can properly profile all the components of the master controller. Preliminary tests show machines in aggregate are more processor intensive than atmospherics.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5570 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -132,63 +132,28 @@ datum/controller/game_controller/proc/process()
|
|||||||
|
|
||||||
//MOBS
|
//MOBS
|
||||||
timer = world.timeofday
|
timer = world.timeofday
|
||||||
var/i = 1
|
process_mobs()
|
||||||
while(i<=mob_list.len)
|
|
||||||
var/mob/M = mob_list[i]
|
|
||||||
if(M)
|
|
||||||
last_thing_processed = M.type
|
|
||||||
M.Life()
|
|
||||||
i++
|
|
||||||
continue
|
|
||||||
mob_list.Cut(i,i+1)
|
|
||||||
mobs_cost = (world.timeofday - timer) / 10
|
mobs_cost = (world.timeofday - timer) / 10
|
||||||
|
|
||||||
sleep(breather_ticks)
|
sleep(breather_ticks)
|
||||||
|
|
||||||
//DISEASES
|
//DISEASES
|
||||||
timer = world.timeofday
|
timer = world.timeofday
|
||||||
i = 1
|
process_diseases()
|
||||||
while(i<=active_diseases.len)
|
|
||||||
var/datum/disease/Disease = active_diseases[i]
|
|
||||||
if(Disease)
|
|
||||||
last_thing_processed = Disease.type
|
|
||||||
Disease.process()
|
|
||||||
i++
|
|
||||||
continue
|
|
||||||
active_diseases.Cut(i,i+1)
|
|
||||||
diseases_cost = (world.timeofday - timer) / 10
|
diseases_cost = (world.timeofday - timer) / 10
|
||||||
|
|
||||||
sleep(breather_ticks)
|
sleep(breather_ticks)
|
||||||
|
|
||||||
//MACHINES
|
//MACHINES
|
||||||
timer = world.timeofday
|
timer = world.timeofday
|
||||||
i = 1
|
process_machines()
|
||||||
while(i<=machines.len)
|
|
||||||
var/obj/machinery/Machine = machines[i]
|
|
||||||
if(Machine)
|
|
||||||
last_thing_processed = Machine.type
|
|
||||||
if(Machine.process() != PROCESS_KILL)
|
|
||||||
if(Machine)
|
|
||||||
if(Machine.use_power)
|
|
||||||
Machine.auto_use_power()
|
|
||||||
i++
|
|
||||||
continue
|
|
||||||
machines.Cut(i,i+1)
|
|
||||||
machines_cost = (world.timeofday - timer) / 10
|
machines_cost = (world.timeofday - timer) / 10
|
||||||
|
|
||||||
sleep(breather_ticks)
|
sleep(breather_ticks)
|
||||||
|
|
||||||
//OBJECTS
|
//OBJECTS
|
||||||
timer = world.timeofday
|
timer = world.timeofday
|
||||||
i = 1
|
process_objects()
|
||||||
while(i<=processing_objects.len)
|
|
||||||
var/obj/Object = processing_objects[i]
|
|
||||||
if(Object)
|
|
||||||
last_thing_processed = Object.type
|
|
||||||
Object.process()
|
|
||||||
i++
|
|
||||||
continue
|
|
||||||
processing_objects.Cut(i,i+1)
|
|
||||||
objects_cost = (world.timeofday - timer) / 10
|
objects_cost = (world.timeofday - timer) / 10
|
||||||
|
|
||||||
sleep(breather_ticks)
|
sleep(breather_ticks)
|
||||||
@@ -196,46 +161,21 @@ datum/controller/game_controller/proc/process()
|
|||||||
//PIPENETS
|
//PIPENETS
|
||||||
if(!pipe_processing_killed)
|
if(!pipe_processing_killed)
|
||||||
timer = world.timeofday
|
timer = world.timeofday
|
||||||
last_thing_processed = /datum/pipe_network
|
process_pipenets()
|
||||||
i = 1
|
|
||||||
while(i<=pipe_networks.len)
|
|
||||||
var/datum/pipe_network/Network = pipe_networks[i]
|
|
||||||
if(Network)
|
|
||||||
Network.process()
|
|
||||||
i++
|
|
||||||
continue
|
|
||||||
pipe_networks.Cut(i,i+1)
|
|
||||||
networks_cost = (world.timeofday - timer) / 10
|
networks_cost = (world.timeofday - timer) / 10
|
||||||
|
|
||||||
sleep(breather_ticks)
|
sleep(breather_ticks)
|
||||||
|
|
||||||
//POWERNETS
|
//POWERNETS
|
||||||
timer = world.timeofday
|
timer = world.timeofday
|
||||||
last_thing_processed = /datum/powernet
|
process_powernets()
|
||||||
i = 1
|
|
||||||
while(i<=powernets.len)
|
|
||||||
var/datum/powernet/Powernet = powernets[i]
|
|
||||||
if(Powernet)
|
|
||||||
Powernet.reset()
|
|
||||||
i++
|
|
||||||
continue
|
|
||||||
powernets.Cut(i,i+1)
|
|
||||||
powernets_cost = (world.timeofday - timer) / 10
|
powernets_cost = (world.timeofday - timer) / 10
|
||||||
|
|
||||||
sleep(breather_ticks)
|
sleep(breather_ticks)
|
||||||
|
|
||||||
//EVENTS
|
//EVENTS
|
||||||
timer = world.timeofday
|
timer = world.timeofday
|
||||||
last_thing_processed = /datum/event
|
process_events()
|
||||||
i = 1
|
|
||||||
while(i<=events.len)
|
|
||||||
var/datum/event/Event = events[i]
|
|
||||||
if(Event)
|
|
||||||
Event.process()
|
|
||||||
i++
|
|
||||||
continue
|
|
||||||
events.Cut(i,i+1)
|
|
||||||
checkEvent()
|
|
||||||
events_cost = (world.timeofday - timer) / 10
|
events_cost = (world.timeofday - timer) / 10
|
||||||
|
|
||||||
//TICKER
|
//TICKER
|
||||||
@@ -254,6 +194,87 @@ datum/controller/game_controller/proc/process()
|
|||||||
else
|
else
|
||||||
sleep(10)
|
sleep(10)
|
||||||
|
|
||||||
|
datum/controller/game_controller/proc/process_mobs()
|
||||||
|
var/i = 1
|
||||||
|
while(i<=mob_list.len)
|
||||||
|
var/mob/M = mob_list[i]
|
||||||
|
if(M)
|
||||||
|
last_thing_processed = M.type
|
||||||
|
M.Life()
|
||||||
|
i++
|
||||||
|
continue
|
||||||
|
mob_list.Cut(i,i+1)
|
||||||
|
|
||||||
|
datum/controller/game_controller/proc/process_diseases()
|
||||||
|
var/i = 1
|
||||||
|
while(i<=active_diseases.len)
|
||||||
|
var/datum/disease/Disease = active_diseases[i]
|
||||||
|
if(Disease)
|
||||||
|
last_thing_processed = Disease.type
|
||||||
|
Disease.process()
|
||||||
|
i++
|
||||||
|
continue
|
||||||
|
active_diseases.Cut(i,i+1)
|
||||||
|
|
||||||
|
datum/controller/game_controller/proc/process_machines()
|
||||||
|
var/i = 1
|
||||||
|
while(i<=machines.len)
|
||||||
|
var/obj/machinery/Machine = machines[i]
|
||||||
|
if(Machine)
|
||||||
|
last_thing_processed = Machine.type
|
||||||
|
if(Machine.process() != PROCESS_KILL)
|
||||||
|
if(Machine)
|
||||||
|
if(Machine.use_power)
|
||||||
|
Machine.auto_use_power()
|
||||||
|
i++
|
||||||
|
continue
|
||||||
|
machines.Cut(i,i+1)
|
||||||
|
|
||||||
|
datum/controller/game_controller/proc/process_objects()
|
||||||
|
var/i = 1
|
||||||
|
while(i<=processing_objects.len)
|
||||||
|
var/obj/Object = processing_objects[i]
|
||||||
|
if(Object)
|
||||||
|
last_thing_processed = Object.type
|
||||||
|
Object.process()
|
||||||
|
i++
|
||||||
|
continue
|
||||||
|
processing_objects.Cut(i,i+1)
|
||||||
|
|
||||||
|
datum/controller/game_controller/proc/process_pipenets()
|
||||||
|
last_thing_processed = /datum/pipe_network
|
||||||
|
var/i = 1
|
||||||
|
while(i<=pipe_networks.len)
|
||||||
|
var/datum/pipe_network/Network = pipe_networks[i]
|
||||||
|
if(Network)
|
||||||
|
Network.process()
|
||||||
|
i++
|
||||||
|
continue
|
||||||
|
pipe_networks.Cut(i,i+1)
|
||||||
|
|
||||||
|
datum/controller/game_controller/proc/process_powernets()
|
||||||
|
last_thing_processed = /datum/powernet
|
||||||
|
var/i = 1
|
||||||
|
while(i<=powernets.len)
|
||||||
|
var/datum/powernet/Powernet = powernets[i]
|
||||||
|
if(Powernet)
|
||||||
|
Powernet.reset()
|
||||||
|
i++
|
||||||
|
continue
|
||||||
|
powernets.Cut(i,i+1)
|
||||||
|
|
||||||
|
datum/controller/game_controller/proc/process_events()
|
||||||
|
last_thing_processed = /datum/event
|
||||||
|
var/i = 1
|
||||||
|
while(i<=events.len)
|
||||||
|
var/datum/event/Event = events[i]
|
||||||
|
if(Event)
|
||||||
|
Event.process()
|
||||||
|
i++
|
||||||
|
continue
|
||||||
|
events.Cut(i,i+1)
|
||||||
|
checkEvent()
|
||||||
|
|
||||||
datum/controller/game_controller/proc/Recover() //Mostly a placeholder for now.
|
datum/controller/game_controller/proc/Recover() //Mostly a placeholder for now.
|
||||||
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"
|
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"
|
||||||
for(var/varname in master_controller.vars)
|
for(var/varname in master_controller.vars)
|
||||||
|
|||||||
Reference in New Issue
Block a user