Optimize usage of StringBuilder's capacity