apache / apache/lucene

ArrayLists should be created with explicit size if known [LUCENE-7691]

Open
#8,742 4 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Trivial type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Many places in Lucene there are ArrayLists being created with no explicit size set even when the exact size is known in advance. In these places, the size should be passed in so the underlying array is sized correctly the first time.

---
Migrated from [LUCENE-7691](https://issues.apache.org/jira/browse/LUCENE-7691) by Michael Braun (@michaelbraun)

Contributor guide

Open the contributing guide

Research direction

No specific files or tests are named. Search the Lucene repository for ArrayList constructions whose required size is already known, inspect each candidate to confirm the size is available, and run the relevant existing tests after updating the identified locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
performance, search
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.