-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8338931: ZipEntry.flag could be made internal to ZipOutputStream #20702
Conversation
👋 Welcome back eirbjo! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
I need to spend some more time thinking about this, but I can ask what made you decide to look at this? Changing the field name from flag -> flags then becomes a bit confusing as for example its usage in initCEN and the name of CENFLG. The field is also used via ZipInputStream (not via ZipEntry but flag). So some thought needs to be given to the naming Similar comment for ZipFileSystem as if we move forward, then we need to be consistent in naming otherwise it becomes (or can be) confusing for future maintainers. Also the Zip Spec refers to the field as "general purpose bit flag" and the zlib repository includes a minzip, which also references this field as flag which might be another reason to keep the field name as is regardless of it moving to XEntry |
Sorry, the renaming was just an accident, It was “flags” in my head, but that was wrong. Will revert the rename once I’m in front of a keyboard again in a few days. The reason I’m looking at this is that ZipEntry is 88 bytes, and allocation is a significant cost when enumerating and looking up entries. So it would be beneficial to move unused or optional parts out of these common read paths. This seemed like a small but obvious win. |
This reverts commit 4ac3abf.
@eirbjo This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@eirbjo This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
Please review this refactoring PR which moves the
ZipEntry.flag
field back toZipOutputStream.XEntry
.Moving this field will save four bytes from the
ZipEntry
object size and also saves an unneccessary read inZipFile.getZipEntry
.Testing:
This PR is a refactoring of existing code and does not update any tests. I added the label
noreg-cleanup
to the JBS issue.The following runs clean:
Performance:
The JMH benchmark
java.util.zip.ZipFileGetEntry.getEntryHit
show a small but consistent improvement (2-3%).Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20702/head:pull/20702
$ git checkout pull/20702
Update a local copy of the PR:
$ git checkout pull/20702
$ git pull https://git.openjdk.org/jdk.git pull/20702/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20702
View PR using the GUI difftool:
$ git pr show -t 20702
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20702.diff
Webrev
Link to Webrev Comment