[
https://issues.apache.org/jira/browse/MYFACES-4244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570611#comment-16570611
]
ASF GitHub Bot commented on MYFACES-4244:
-----------------------------------------
pnicolucci commented on issue #10: MYFACES-4244:Use StringBuilder rather than
calling write multiple times
URL: https://github.com/apache/myfaces/pull/10#issuecomment-410808355
After additional investigation we've determined this change is not necessary
so I'm closing this Pull request.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [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)