ID:53615
 
A post by LummoxJR made me realize that something similar to what I was attempting with my RefSortedList is already hard coded into BYOND with associative lists. I updated my Region library to use them rather than standard lists and got a massive performance boost which should make it run much much better on large areas and even a good performance boost on smaller ones.

http://www.byond.com/developer/Theodis/Region
Interesting. But wouldn't it be better to add a check to see if the mob has entered a new turf, instead of doing the proc over and over and over again every step? I can imagine it'd take in quite some resources.

    Entered(atom/movable/a)
if(ismob(a))
var/mob/M=a
if(M.curicon!=icon)
ClearMap()
var/Region/r = new(a.loc, /proc/AccessibleTurfs)
for(var/turf/t in r.contents)
t.icon = 'red.dmi'
M.curicon=icon
return 1
mob/var/curicon


EDIT: Okay so DM doesn't work, but you get the gist.