We're updating the issue view to help you get more done. 

Minor performance improvement

Description

https://github.com/igniterealtime/Openfire/blob/master/src/java/org/jivesoftware/openfire/nio/XMLLightweightParser.java#384

Check for exact lengths of both strings instead of > 0. We have one additional length check but the string conversions happen only when the string length matches.

This change should be save, anyhow comments are welcome.

 

And as we know that the length of head will get ~16 bytes one could initialize it with at least 16 bytes to avoid that the JVM extends the buffer during runtime. Currently 5 bytes are used: "protected StringBuilder head = new StringBuilder(5);"

 

 

Environment

None

Acceptance Test - Entry

None
Fixed

Assignee

Greg Thomas

Reporter

LG

Labels

None

Expected Effort

None

Ignite Forum URL

None

Components

Fix versions

Affects versions

Priority

Trivial
Configure