Nuno Santos created OAK-12412:
---------------------------------
Summary: Cache RecordType.values() in ImmutableRecordNumbers
Key: OAK-12412
URL: https://issues.apache.org/jira/browse/OAK-12412
Project: Jackrabbit Oak
Issue Type: Improvement
Components: segment-tar
Reporter: Nuno Santos
{{ImmutableRecordNumbers}}'s iterator resolves each entry's record type via
{{RecordType.values()[type[pos]]}} inside {{computeNext()}}/{{getType()}}.
{{Enum.values()}} allocates and returns a new array on every call, so this
array is needlessly re-allocated once per iterated entry.
The set of {{RecordType}} values is fixed, so cache the array once in a
{{private static final}} field and reuse it from the iterator instead of
calling {{RecordType.values()}} per entry.
No behavioral change intended.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)