Hard to say with such limited information.
Are you sure _x and _y are in pixels and not already in coords?
Also, if your map is a regular grid (tilemap), instead of looping on and testing every tile, loop on x from the tile corresponding to the left side of the view to the tile corresponding to the right side of the view and loop on y from the top tile in the view to the bottom tile in the view. (divide the view coordinate by your tile width to get these tile indices)