This worked fine (with no performance penalty) in 13.9. The code is used in Magnet mod to check if the player is active (whatever that means).
Basically, running this code every several ticks takes more than 40 ms per update:
Code: Select all
local index = player.position
player.surface.find_entities_filtered{area={index,index}, name="player"}