Sped up the /proc/powernet_nextlink() proc.

Profile results (total time)
Proc Name                                                                         Self CPU    Total CPU    Real Time        Calls
-----------------------------------------------------------------------------    ---------    ---------    ---------    ---------
Before Revision
/proc/powernet_nextlink                                                              0.068       14.892       14.895         2936
/proc/powernet_nextlink                                                              0.000        0.005        0.005         2936
Before Revision
/proc/powernet_nextlink                                                              0.077       18.886       18.887         3162
/proc/powernet_nextlink                                                              0.000        0.006        0.006         3162
After Revision
/proc/powernet_nextlink                                                              0.046       15.185       15.186         3022
/proc/powernet_nextlink                                                              0.000        0.005        0.005         3022

This decreases the overhead on larger powernet_nextlink() calls and also decreases the cpu usage for the client by ~30%
For larger powernet_nextlink() calls the cpu usage serverside is decreased by a factor of ~30% also.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1691 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rockdtben
2011-06-14 14:13:27 +00:00
parent 81e133e045
commit 482d0f2d95

View File

@@ -195,23 +195,13 @@
var/obj/cable/C = O
C.netnum = num
else if( istype(O, /obj/machinery/power) )
var/obj/machinery/power/M = O
M.netnum = num
if( istype(O, /obj/cable) )
var/obj/cable/C = O
P = C.get_connections()
else if( istype(O, /obj/machinery/power) )
var/obj/machinery/power/M = O
M.netnum = num
P = M.get_connections()
if(P.len == 0)