Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8311517: Add performance information to ArrayList javadoc #15040

Closed
wants to merge 2 commits into from

Conversation

danthe1st
Copy link
Contributor

@danthe1st danthe1st commented Jul 26, 2023

The JEP for sequenced collections would add addFirst(), removeFirst() and reversed() methods to lists.
However, the Javadoc of List mentions:

The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, adding n elements requires O(n) time. All of the other operations run in linear time (roughly speaking). The constant factor is low compared to that for the LinkedList implementation.

This PR updates that Javadoc to factor in the new methods introduced by JEP 431.

https://bugs.openjdk.org/browse/JDK-8311517
https://mail.openjdk.org/pipermail/core-libs-dev/2023-June/107328.html
https://mail.openjdk.org/pipermail/core-libs-dev/2023-July/109637.html

This PR only affects documentation.


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
  • Change requires CSR request JDK-8313723 to be approved

Issues

  • JDK-8311517: Add performance information to ArrayList javadoc (Bug - P4)
  • JDK-8313723: Add performance information to ArrayList javadoc (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15040

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 26, 2023

👋 Welcome back danthe1st! 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 added the rfr Pull request is ready for review label Jul 26, 2023
@openjdk
Copy link

openjdk bot commented Jul 26, 2023

@danthe1st 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 core-libs core-libs-dev@openjdk.org label Jul 26, 2023
@danthe1st
Copy link
Contributor Author

/label javadoc

@openjdk openjdk bot added the javadoc javadoc-dev@openjdk.org label Jul 26, 2023
@openjdk
Copy link

openjdk bot commented Jul 26, 2023

@danthe1st
The javadoc label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Jul 26, 2023

Webrevs

@stuart-marks
Copy link
Member

Hi, thanks for working on this.

I've changed the bug summary line to be more descriptive:

Add performance information to ArrayList javadoc

The PR title needs to be changed to match. I hope this is ok.

Regarding the text of the change: should getFirst() and getLast() be mentioned? They were added by Sequenced Collections, and they run in constant time. Also, while add() and addLast() run in amortized constant time (because of the possibility of array growth) removeLast() runs in absolute constant time; it never copies or reallocates the array.

@stuart-marks
Copy link
Member

/csr

A CSR is required for this change, as these are normative statements about the performance of this implementation.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jul 26, 2023
@openjdk
Copy link

openjdk bot commented Jul 26, 2023

@stuart-marks has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@danthe1st please create a CSR request for issue JDK-8311517 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@danthe1st
Copy link
Contributor Author

danthe1st commented Jul 26, 2023

I don't think I can create a CSR request without an OpenJDK/JBS account (This is my first contribution to an OpenJDK project so I think I'm not eligible for an OpenJDK/JBS account). Is this correct?

@stuart-marks
Copy link
Member

Yes, that's correct. I'll create a CSR for this when the change settles down.

@danthe1st danthe1st changed the title 8311517: ArrayList javadoc improvements related to sequenced collection updates 8311517: Add performance information to ArrayList javadoc Jul 27, 2023
@danthe1st
Copy link
Contributor Author

Regarding the text of the change: should getFirst() and getLast() be mentioned? They were added by Sequenced Collections, and they run in constant time. Also, while add() and addLast() run in amortized constant time (because of the possibility of array growth) removeLast() runs in absolute constant time; it never copies or reallocates the array.

I fully agree with that and made the requested changes.

@danthe1st
Copy link
Contributor Author

danthe1st commented Aug 2, 2023

@stuart-marks Can you please create the CSR request as mentioned above or are there further changes I should do?

Copy link
Member

@stuart-marks stuart-marks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. I've drafted a CSR; see link in header. Please take a look.

@danthe1st
Copy link
Contributor Author

danthe1st commented Aug 4, 2023

Thanks for the updates. I've drafted a CSR; see link in header. Please take a look.

@stuart-marks Thanks, the CSR looks good to me. I guess the Fix versions field will be added when the CSR is reviewed?
Also, I guess this change will not be backported to 21 as it requires a CSR and we are approaching the initial release candidate?

@rgiulietti
Copy link
Contributor

LGTM (not a Reviewer)

@stuart-marks
Copy link
Member

@danthe1st

Thanks, the CSR looks good to me. I guess the Fix versions field will be added when the CSR is reviewed?
Also, I guess this change will not be backported to 21 as it requires a CSR and we are approaching the initial release candidate?

I've marked the CSR with Fix-Version 22. The bug itself should have its Fix-Version stay at "tbd" because it gets filled in automatically when the change is integrated. That doesn't happen for CSRs. (Admittedly this is kind of confusing and there's been some discussion about the best way to handle this.)

Right, it's too late to get this into JDK 21, and there's no compelling reason to do so. For stuff like this we just fix it in the "latest" release and move forward.

@openjdk
Copy link

openjdk bot commented Aug 4, 2023

⚠️ @danthe1st the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout 8311517-arraylist-javadoc
$ git commit --author='Preferred Full Name <you@example.com>' --allow-empty -m 'Update full name'
$ git push

@openjdk
Copy link

openjdk bot commented Aug 4, 2023

@danthe1st This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8311517: Add performance information to ArrayList javadoc

Reviewed-by: smarks, bpb

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 103 new commits pushed to the master branch:

  • b2add96: 8159527: Collections mutator methods should all be marked as optional operations
  • 873d117: 8312623: SA add NestHost and NestMembers attributes when dumping class
  • 017e0c7: 8310388: Shenandoah: Auxiliary bitmap is not madvised for THP
  • f66cd50: 8313564: Fix -Wconversion warnings in classfile code
  • e8a37b9: 8313248: C2: setScopedValueCache intrinsic exposes nullptr pre-values to store barriers
  • 29f1d8e: 8313707: GHA: Bootstrap sysroots with --variant=minbase
  • 61c58fd: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match
  • 5d23295: 8313251: Add NativeLibraryLoad event
  • c4b8574: 8311938: Add default cups include location for configure on AIX
  • 10a2605: 8294979: test/jdk/tools/jlink 3 test classes use ASM library
  • ... and 93 more: https://git.openjdk.org/jdk/compare/1f81e5b19ebfb7cd1b5a01d6cf79efda7e827c35...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@stuart-marks, @bplb) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Aug 4, 2023
@danthe1st
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 4, 2023
@openjdk
Copy link

openjdk bot commented Aug 4, 2023

@danthe1st
Your change (at version 20fddb1) is now ready to be sponsored by a Committer.

@stuart-marks
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 4, 2023

Going to push as commit b463c6d.
Since your change was applied there have been 103 commits pushed to the master branch:

  • b2add96: 8159527: Collections mutator methods should all be marked as optional operations
  • 873d117: 8312623: SA add NestHost and NestMembers attributes when dumping class
  • 017e0c7: 8310388: Shenandoah: Auxiliary bitmap is not madvised for THP
  • f66cd50: 8313564: Fix -Wconversion warnings in classfile code
  • e8a37b9: 8313248: C2: setScopedValueCache intrinsic exposes nullptr pre-values to store barriers
  • 29f1d8e: 8313707: GHA: Bootstrap sysroots with --variant=minbase
  • 61c58fd: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match
  • 5d23295: 8313251: Add NativeLibraryLoad event
  • c4b8574: 8311938: Add default cups include location for configure on AIX
  • 10a2605: 8294979: test/jdk/tools/jlink 3 test classes use ASM library
  • ... and 93 more: https://git.openjdk.org/jdk/compare/1f81e5b19ebfb7cd1b5a01d6cf79efda7e827c35...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 4, 2023
@openjdk openjdk bot closed this Aug 4, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 4, 2023
@openjdk
Copy link

openjdk bot commented Aug 4, 2023

@stuart-marks @danthe1st Pushed as commit b463c6d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@danthe1st danthe1st deleted the 8311517-arraylist-javadoc branch August 4, 2023 20:21
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 integrated Pull request has been integrated javadoc javadoc-dev@openjdk.org
4 participants