Whats the best way to handle lots of NPCs/Humanoids?

lets say i mad a Enemy that always walks towards your player, ill do this

while true do
Enemy:MoveTo(myplayer.Position)
end

but what if there was 100 enemies? would i do this?

while true do
     for i,enemy in pairs(enemies) do
          enemy:MoveTo(myplayer.Position)
     end
end

would that be the best way to do it? will it cause lag? maybe coroutines?

Put it on a loop that’s hooked up to RunService.Heartbeat