To help debug performance issues we are seeing in another add-in, I created a new, simple add-in with one button which adds 50 point text elements at random positions on an empty layout. I did tests with and without a map tab open. Here is the code for adding an modifying the elements:
GraphicElement element = LayoutElementFactory.Instance.CreatePointTextGraphicElement(layout, location.Coordinate2D, text);
element.SetAnchor(Anchor.LeftMidPoint);
element.SetRotation(ELEMENT_ANGLE);
Here are my test results:
Create, SetAnchor, and SetRotation on 50 elements with no map in project: ~3s
Create elements only on 50 elements with map tab open: ~20s
Create and SetAnchor on 50 elements with map tab open: ~2m
Create, SetAnchor, and SetRotation on 50 elements with map tab open: ~3m
Create, SetAnchor, and SetRotation on 50 elements with closed map in project: ~3s
In all of these cases, the layout being modified was in the project contents, but not an open tab. The map was empty, and had no connection to the layout other than being in the same project.
I would not expect having a map tab open to affect the performance of adding elements to an unrelated layout. Am I doing something wrong here? Is it possible to improve performance with the map tab open?