Skip to content

[CORE] Use ArrayList instead of LinkedList in Spillers#11619

Open
acvictor wants to merge 1 commit intoapache:mainfrom
acvictor:acvictor/useArrayListInSpillers
Open

[CORE] Use ArrayList instead of LinkedList in Spillers#11619
acvictor wants to merge 1 commit intoapache:mainfrom
acvictor:acvictor/useArrayListInSpillers

Conversation

@acvictor
Copy link
Contributor

What changes are proposed in this pull request?

This PR replaces LinkedList with ArrayList in Spillers.AppendableSpillerList. The list is only used for two operations: add() (append) and sequential for-each iteration in spill(). ArrayList is more efficient for both: append is amortized O(1) without allocating a Node object per element, and iteration benefits from sequential memory layout (CPU cache locality). LinkedList is faster for frequent mid-list insertions/removals, which this class never does.

How was this patch tested?

Existing unit tests.

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the CORE works for Gluten Core label Feb 15, 2026
@github-actions
Copy link

Run Gluten Clickhouse CI on x86

@acvictor acvictor marked this pull request as ready for review February 15, 2026 18:36
@acvictor
Copy link
Contributor Author

@zhztheplayer can you please review this PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant