Frequent use of StringBuffer instead of StringBuilder is hurting performance
While profiling a project recently I found that a significant amount of the total load time was being
wasted in the ASM libraries on the synchronized append() calls of the StringBuffer class.
This is totally unnecessary! The java standard StringBuilder class provides a compatible interface
and its append() calls are not synchronized.
I've attached a patch file to this bug which replaces the usage of StringBuffer with StringBuilder.
I believe the patch will not cause any significant compatibility issues since the only public
interfaces it touched were the following:
./asm/examples/attributes/src/Attributes.java: public void textify(StringBuilder buf, Map<Label,
String> labelNames) {
./asm/src/org/objectweb/asm/util/Printer.java: public static void appendString(final StringBuilder
buf, final String s) {
./asm/test/conform/org/objectweb/asm/attrs/CodeComment.java: public void asmify(final
StringBuilder buf, final String varName,
./asm/test/conform/org/objectweb/asm/attrs/CodeComment.java: public void textify(final
StringBuilder buf,
./asm/test/conform/org/objectweb/asm/attrs/Comment.java: public void asmify(final
StringBuilder buf, final String varName,
./asm/test/conform/org/objectweb/asm/attrs/Comment.java: public void textify(final
StringBuilder buf,
./asmdex/src/org/ow2/asmdex/util/TextLeaf.java: public TextLeaf(StringBuilder text) {
./eclipse/plugin/src/de/loskutov/bco/views/HelpUtils.java: public static StringBuilder
getOpcodeHelpFor(int opcode) {