NavigationServer2D > region_set_navigation_polygon is slowing down and stuck UI of game

Thank you everyone for please answers.
There really are a lot of polygons to be processed. In my case, the ideal is for me to implement some polygon union algorithm to create a large polygon that represents a set of smaller polygons, thus reducing the number of polygons and optimizing performance.