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

ZoneIdPrinterParser can be optimized

    Details

    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b147

      Description

      Every time you parse a ZonedDateTime that contains a zone id the method ZoneRulesProvider.getAvailableZoneIds() is called in the ZoneIdPrinterParser.

      This method can be very costly. Since there is already a cache to avoid to recreate the SubstringTree it should be possible
      to call the ZoneRulesProvider.getAvailableZoneIds() method only when this cache is updated.

      For example something like

      Set regionIds = cachedRegionIds;
      final int regionIdsSize = ZoneRulesProvider.getAvailableZoneIdsSize(); // Return only the size of ZONES in ZoneRulesProvider
      Entry cached = cachedSubstringTree;
      if (cached == null || cached.getKey() != regionIdsSize) {
      cachedRegionIds = ZoneRulesProvider.getAvailableZoneIds();
      ...

      Instead of

      Set regionIds = ZoneRulesProvider.getAvailableZoneIds();
      final int regionIdsSize = regionIds.size();
      Entry cached = cachedSubstringTree;
      if (cached == null || cached.getKey() != regionIdsSize) {
      ...



      Originally proposed as https://github.com/ThreeTen/threeten/issues/350

        Activity

        rriggs Roger Riggs created issue -
        rriggs Roger Riggs made changes -
        Field Original Value New Value
        Status New [ 10000 ] Open [ 1 ]
        bgopularam Bhanu Prakash Gopularam made changes -
        Assignee Roger Riggs [ rriggs ] Bhanu Prakash Gopularam [ bgopularam ]
        ntv Nadeesh Tv (Inactive) made changes -
        Comment [ A comment with security level 'Confidential' was removed. ]
        bgopularam Bhanu Prakash Gopularam made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Understanding Cause Known [ 10000 ]
        rriggs Roger Riggs made changes -
        Fix Version/s tbd_minor [ 11999 ]
        bgopularam Bhanu Prakash Gopularam made changes -
        Labels release-note=yes
        hgupdate HG Updates made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolved In Build team [ 17324 ]
        Understanding Cause Known [ 10000 ]
        Fix Version/s 9 [ 14949 ]
        Fix Version/s tbd_minor [ 11999 ]
        Resolution Fixed [ 1 ]
        hgupdate HG Updates made changes -
        Resolved In Build team [ 17324 ] master [ 18256 ]
        hgupdate HG Updates made changes -
        Resolved In Build master [ 18256 ] b147 [ 17564 ]
        iris Iris Clark made changes -
        Labels release-note=yes jsr379-annex2-tbd release-note=yes
        iris Iris Clark made changes -
        Labels jsr379-annex2-tbd release-note=yes jsr379-annex1 release-note=yes
        darcy Joe Darcy made changes -
        Link This issue csr of CCC-8066291 [ CCC-8066291 ]

          People

          • Assignee:
            bgopularam Bhanu Prakash Gopularam
            Reporter:
            rriggs Roger Riggs
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: