mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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 ```
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user