Understanding Performance Issues When Using the Text and TextRange Control Patterns
This topic describes performance issues associated with using the Text and TextRange control patterns.
The IUIAutomationTextPattern and IUIAutomationTextRange interfaces rely on cross-process calls—they do not provide a caching mechanism to improve performance when retrieving or processing textual content.
A client application can improve performance by using the IUIAutomationTextRange::GetText method to retrieve moderately sized blocks of text. For example, using GetText to retrieve single characters will incur a cross-process performance hit for each character, whereas not specifying a maximum length when calling GetText will incur one cross-process hit, but can have high latency depending on the size of the text range.
Related topics
Working with Text-based Controls, UI Automation Support for Textual Content, About the Text and TextRange Control Patterns, UI Automation Client Programmer's Guide
For UI Automation Providers, see Text and TextRange Control Patterns