Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8079223

unnecessary performance degradation caused by fix to JDK-8052111

XMLWordPrintable

    • b15
    • Not verified

        The problem is caused by the security fix for : https://bugs.openjdk.java.net/browse/JDK-8079072
        In that fix we stopped reading in from the cached index file the following fields:
        validationTimeStamp,
        knownToBeSigned,
        blacklistValidationTime,
        certExpirationDate,
        classVerificationStatus,
        hasOnlySignedEntries,
        hasSingleCodeSource,
        hasMissingSignedEntries, and
        trustedLibrariesValidationTime,

        and these are re-computed on every run. Now it was originally thought that this performance degradation was caused by the time needed to recompute these values, but that proved to be negligible.
        The problem is that after they are re-computed, there are places which will re-write the index file with the changed values.
        the one place in CacheEntry.readIndexFile():
        > if (hasSigningInfo() &&
        > ((section4Pre15Length == 0 && enhancedJarAccess) ||
        > BlackList.getInstance().hasBeenModifiedSince(blacklistValidationTime) ||
        > TrustedLibraries.hasBeenModifiedSince(trustedLibrariesValidationTime)) &&
        > (!Cache.isSystemCacheEntry(this) || Environment.isSystemCacheMode())) {
        >
        > raf.close();
        > raf = null;
        > saveUpgrade();
        was comparing against blacklistValidationTime and trustedLibrariesValidationTime (which are no longer reasons to write the index, since these values in the cache are ignored).
        just changing that to:
        > if (hasSigningInfo() &&
        > ((section4Pre15Length == 0 && enhancedJarAccess) &&
        > (!Cache.isSystemCacheEntry(this) || Environment.isSystemCacheMode())) {
        >
        > raf.close();
        > raf = null;
        > saveUpgrade();

              herrick Andy Herrick (Inactive)
              herrick Andy Herrick (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: