This means the startup cost is also less. Layout logic is also a source of resource consumption in the latter, as it uses FlowDocument internally for layout, whereas TextBox is just a simple stream of text.
Here are some metrics to compare 1000 instances of TextBox versus 1000 instances of RichTextBox:
Initial memory: 45MB vs 60MB (33% heavier)
Memory used: 3MB
Control creation time: 120ms vs 250ms
Restoring a mass of text boxes from memory will take half the time if we use a regular TextBox versus a RichTextBox.
No comments:
Post a Comment