Skip to content

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

Merged
yaooqinn merged 1 commit intoapache:mainfrom
acvictor:acvictor/useArrayListInSpillers
Feb 24, 2026
Merged

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

Conversation

@acvictor
Copy link
Copy Markdown
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
Copy Markdown

Run Gluten Clickhouse CI on x86

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

@zhztheplayer can you please review this PR? Thanks!

@yaooqinn yaooqinn merged commit 9c784b3 into apache:main Feb 24, 2026
60 checks passed
@acvictor acvictor deleted the acvictor/useArrayListInSpillers branch March 3, 2026 05:25
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.

3 participants