nfsantos opened a new pull request, #3148: URL: https://github.com/apache/jackrabbit-oak/pull/3148
https://issues.apache.org/jira/browse/OAK-12413 Several `ArrayList`s allocated in `DefaultSegmentWriter`'s write/compaction path (the map-entry list built from `changes`, the leaf-bucket list built from map buckets, the property value-id list, and the node/property id lists built while writing a node) — plus the property-templates list built in `Template`'s constructor — start at the default initial capacity and grow by repeated internal array reallocation and copy as elements are added, even though their eventual size is already known at the allocation site (`changes.size()`, `newSize`, `count`, `state.getPropertyCount()`, `template.getPropertyTemplates().length`). Pre-size these lists using the already-available size hint (`new ArrayList<>(knownSize)`) to avoid the repeated growth/copy, which happens on every node, property and map entry written during compaction. No behavioral change intended. ## Test plan - [x] `mvn -pl oak-segment-tar test -Dtest=DefaultSegmentWriterTest,TemplateTest,RecordTest` passes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
