[
https://issues.apache.org/jira/browse/OAK-12412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Reschke closed OAK-12412.
--------------------------------
> Cache RecordType.values() in ImmutableRecordNumbers and MutableRecordNumbers
> ----------------------------------------------------------------------------
>
> Key: OAK-12412
> URL: https://issues.apache.org/jira/browse/OAK-12412
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: segment-tar
> Reporter: Nuno Santos
> Priority: Major
> Fix For: 2.8.0
>
>
> Both {{ImmutableRecordNumbers}} and {{MutableRecordNumbers}} resolve a
> record's type via {{RecordType.values()[...]}} inside their iterator's
> {{getType()}}. {{Enum.values()}} allocates and returns a new array on every
> call, so this array is needlessly re-allocated once per iterated entry, in
> both classes.
> The set of {{RecordType}} values is fixed, so cache the array once per class
> 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)