ID:2560248
 
(See the best response by Ter13.)
Code:


Problem description:Ok so I was trying to reduce lag and I had the idea of creating a list of turfs to check instead of checking entire areas. This way the built in area types dont have to be used for checking these turfs. If each time a set of around 3000 turfs is checked and i check the contents of each turf for certain mob types is done by going through one list that only contains turfs, and checking them all, is that better, or just as good as checking a bunch of different areas for those types of mobs? It seems to me like it would be because the list of turfs is way shorter, but for(var/mob/m in area) is more of a built in function, so I wasn't sure if it somehow worked faster for some reason. Sorry this is so long, its just one of those days where I just HAVE to know.

Best response
mob/m in area will likely be faster because the filtering is being done by the engine, rather than in softcode, but I think there's a really good chance what you are doing could be done better. Checking turfs/areas to find mobs is probably not the best solution. If you could elaborate on what your code is supposed to do, and why, maybe we could point you to a better pattern.