Repository navigation
ADFA-6854: One packed JarListing per JAR for zipfs2 and javac - #2230
Draft
itsaky-adfa wants to merge 8 commits into
Draft
itsaky-adfa wants to merge 8 commits into
itsaky-adfa wants to merge 8 commits into
Conversation
|
To enable Code Reviewer, link your GitHub account to your Atlassian account. This is a one-time task that takes less than a minute. Once your account is linked, resubmit the pull request to trigger a code review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, part 3 of 4 of the ADFA-6854 stack. Do not merge yet: see "Open items" in the top PR.
Stack (bottom to top):
JarListing, one packed index per JAR for zipfs2 and javacJarListing(needs a kt-android release)What
JarListing(java-compiler,zipfs2.listing) is an immutable index of one JAR, built from one read of the central directory:int[]parent, child and sibling links, with directories the JAR omits synthesized.It has no per-entry objects. Missing zip64 extras and any number of entry kinds behave as zipfs2 does today, so a JAR that opens today still opens.
JarListingCache.SHAREDkeys listings by path. Eachgetdoes onestat. When the size or mtime changes, it drops the listing and notifies listeners (zipfs2 here, the Kotlin VFS in PR 4) before building a new one. Listener failures are collected and rethrown after all listeners have run.zipfs2 listing mode.
CachedJarFileSystems opened throughCachingJarFileSystemProviderkeep nocenbyte array and noIndexNodemap. Lookups, directory iteration and entry reads go through the listing. Writable zip file systems are unchanged.Replaced JARs. A JAR replaced in place is closed and reopened, and is never read with the old listing's offsets.
R.jarwas the only JAR invalidated before; now every JAR is.javac package view.
ListingPackageMapis a lazy view over the listing, sopackageIndex()stores no per-package objects.Measured
OnePlus Pad 2, cold open of CoGo at
stageffaa75be84, heap dump after open. The numbers cover the whole stack.stageIndexNode, names,cen)JarListing, all 405 JARsThe budget was ~15 MB for all JARs. The javac structures (39.2 -> 26.6 MB) are covered in PR 2.
Tests
JarListingTest(21),JarListingCacheTest(11),CachedJarFileSystemListingTestandCachedJarFileSystemPackageIndexTest. They compare againstZipFileand JDK zipfs:javac-services 42/42 and projects 52/52 pass.
Behaviour differences in listing mode, none used by any caller:
extra/commentattributes;multi-releasewas never read by zipfs2).