RFR [8051382] Optimize java.lang.reflect.Modifier.toString()
Martin Buchholz
martinrb at google.com
Tue Jul 22 01:58:00 UTC 2014
On Mon, Jul 21, 2014 at 10:58 AM, Joe Darcy <joe.darcy at oracle.com> wrote:
> Hello,
>
> As a general comment, I think we should use more of StringJoiner in the
> JDK libraries; it would help get rid of some awkward loops, even if it
> isn't that compelling a code benefit in this case.
>
>
In performance critical contexts, one can almost always do a little better
than to use StringJoiner. StringJoiner feels like an odd API. For
performance critical uses, there is no way to presize the output. As a
community, we have still not learned that use of constructors (instead of
factory methods) is usually a design mistake.
> While performance is an important concern, I don't know if producing
> modifier strings is actually performance critical.
>
>
I agree that Modifier.toString is probably not performance critical.
More information about the core-libs-dev
mailing list