Game.creeps.filter vs. room.find (FIND_MY_CREEPS)
-
Which is a more effective way to find all creeps in a room: filtering
Game.creeps
or usingroom.find (FIND_MY_CREEPS)
?
-
Room.find
is optimized for searching in the specified room only, andGame.creeps
contains all creeps within all accessible rooms. If you have many rooms,Room.find
is definitely faster.