Skip to content

8387257: (coll) add fast path for PriorityQueue.addAll(Collection)#31701

Open
PeyaPeyaPeyang wants to merge 4 commits into
openjdk:masterfrom
PeyaPeyaPeyang:8387257-fast-path-for-pqueue-addall
Open

8387257: (coll) add fast path for PriorityQueue.addAll(Collection)#31701
PeyaPeyaPeyang wants to merge 4 commits into
openjdk:masterfrom
PeyaPeyaPeyang:8387257-fast-path-for-pqueue-addall

Conversation

@PeyaPeyaPeyang

@PeyaPeyaPeyang PeyaPeyaPeyang commented Jun 27, 2026

Copy link
Copy Markdown
Member

Added a fast path for PriorityQueue#addAll when adding elements to an empty, exact PriorityQueue instance.

Instead of inserting each element one by one through AbstractQueue#addAll,
the implementation now copies the source collection into the backing array and calls heapify().
This reduces the construction cost for bulk insertion into an empty queue from repeated per-element sift-up work to linear-time heap construction.



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8387257: (coll) add fast path for PriorityQueue.addAll(Collection) (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31701/head:pull/31701
$ git checkout pull/31701

Update a local copy of the PR:
$ git checkout pull/31701
$ git pull https://git.openjdk.org/jdk.git pull/31701/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31701

View PR using the GUI difftool:
$ git pr show -t 31701

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31701.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 27, 2026

Copy link
Copy Markdown

👋 Welcome back dyama! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jun 27, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the core-libs core-libs-dev@openjdk.org label Jun 27, 2026
@openjdk

openjdk Bot commented Jun 27, 2026

Copy link
Copy Markdown

@PeyaPeyaPeyang The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 27, 2026
@mlbridge

mlbridge Bot commented Jun 27, 2026

Copy link
Copy Markdown

Webrevs

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

Labels

core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant