As part of #263499, I'm trying to speed up rendering of chat responses. When a response contains a large number of code blocks, we end up creating a large number of editors for it. One slow part of this is the NativeEditContext. _updateSelectionAndControlBounds call after the editor is created
Here you can see a few of these calls:
This call is slow because it forces a recalculate styles + relayout
In my regular chat session log, we end up spending several hundred ms just on these calls when you first open the session log:
Would it be possible to avoid this call until there is a hint the NativeContext is needed, such as the editor becoming focused?