I\'ve a performance related question regarding use of StringBuilder.
In a very long loop I\'m manipulating a StringBuilder and passing it to another method like
The fastest way is to use "setLength". It won't involve the copying operation. The way to create a new StringBuilder should be completely out. The slow for the StringBuilder.delete(int start, int end) is because it will copy the array again for the resizing part.
System.arraycopy(value, start+len, value, start, count-end);
After that, the StringBuilder.delete() will update the StringBuilder.count to the new size. While the StringBuilder.setLength() just simplify update the StringBuilder.count to the new size.