I am trying to optimize performance for my plugin. My plugin involves robot motion planning and sometimes the frame rate slows down for seemingly trivial things like using Draw2DText() in a loop that runs about 25-30 times. If I remove this drawing loop, the performance almost doubles. In the image below, DrawPassNumbers() has this for loop that runs about 30 times and calls e.Display.Draw2dText()
I was wondering to offload a lot of heavy drawing tasks like the above mentioned loop and drawing of several heavy meshes and breps to their own display conduits. In the above image, each circled draw call could be its own conduit.
I was wondering if anyone can shed some light on performance differences between drawing everything in a single display conduit or having multiple display conduits for different plugin items.