[ https://issues.apache.org/jira/browse/MYFACES-4244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570606#comment-16570606 ]
Paul Nicolucci commented on MYFACES-4244: ----------------------------------------- After additional investigation we've determined this change is not necessary and as such I'm going to cancel this issue. > [perf] Use StringBuilder rather than calling write many times to increase > performance > ------------------------------------------------------------------------------------- > > Key: MYFACES-4244 > URL: https://issues.apache.org/jira/browse/MYFACES-4244 > Project: MyFaces Core > Issue Type: Improvement > Affects Versions: 2.2.12, 2.3.1 > Reporter: Paul Nicolucci > Assignee: Paul Nicolucci > Priority: Minor > > Using StringBuilder.append performs better than calling Writer.write multiple > times because the path length for a StringBuffer.append is less than the path > length of a Writer.write operation. By using StringBuilder, you only have to > call the write method once instead of N number of times per method. > The Shared StringBuilder may have some issues as well if there is any > multi-threaded use of the Shared StringBuilder. If multiple threads could > use a particular StringBuilder you would end up getting incorrect output. > Another issue with the Shared StringBuilder for performance is it requires a > call to get it which can be more expensive than just newing up a new > StringBuilder. > From looking at the myfaces code, the Shared StringBuilder is used only for > special cases presently and not widely used. -- This message was sent by Atlassian JIRA (v7.6.3#76005)