From 42946bd2ade1116a5ee4e5d2f0963053918f1d4d Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Tue, 18 Feb 2014 16:16:10 +1300 Subject: [PATCH] Vent pump efficiency - Tweaked the pressure delta check to "> 0.5", so pumps will stop transferring minor volumes of air every tick (because a delta of 3.05176e-005 is still greater than 0). This also reduces the calls to gas_mixture/merge() and gas_mixture/remove() significantly once the air in the environment has equalized. The results after running the game for 10 minutes: ``` Proc Name Self CPU Total CPU Real Time Calls /obj/machinery/atmospherics/unary/vent_pump/process 0.035 0.141 0.141 3808 <- before /obj/machinery/atmospherics/unary/vent_pump/process 0.014 0.042 0.043 3808 <- after ``` --- code/ATMOSPHERICS/components/unary/vent_pump.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 83f8eb7fcf6..1550eb7ae96 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -100,7 +100,7 @@ if(pressure_checks&2) pressure_delta = min(pressure_delta, (air_contents.return_pressure() - internal_pressure_bound)) - if(pressure_delta > 0) + if(pressure_delta > 0.5) if(air_contents.temperature > 0) var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION) @@ -118,7 +118,7 @@ if(pressure_checks&2) pressure_delta = min(pressure_delta, (internal_pressure_bound - air_contents.return_pressure())) - if(pressure_delta > 0) + if(pressure_delta > 0.5) if(environment.temperature > 0) var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)