You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In object allocation profiling the NodeType's method getNodeType is a very frequent allocator of String and StringBuilder object (in our application is is actually one of the dominating allocators). This puts a lot of pressure on the Garbage Collector.
The javac will turn the String concatenation into a StringBuilder and a subsequent toString(), which will always be done even in the most common case that the ret variable is not null.
Proposal is to instead change the NodeType getNodeType method into:
public static NodeType getNodeType(final JsonNode node)
{
final JsonToken token = node.asToken();
final NodeType ret = TOKEN_MAP.get(token);
if (ret == null)
{
throw new NullPointerException( "unhandled token type " + token);
}
return ret;
}
The text was updated successfully, but these errors were encountered:
In object allocation profiling the NodeType's method getNodeType is a very frequent allocator of String and StringBuilder object (in our application is is actually one of the dominating allocators). This puts a lot of pressure on the Garbage Collector.
The javac will turn the String concatenation into a StringBuilder and a subsequent toString(), which will always be done even in the most common case that the ret variable is not null.
Proposal is to instead change the NodeType getNodeType method into:
The text was updated successfully, but these errors were encountered: