Improve Set.of(...).iterator() warmup characteristics

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 15
    • Affects Version/s: None
    • Component/s: core-libs

      The iterators for ImmutableCollections.SetN and Set12 can be improved to improve startup and warmup characteristics. This has measurable impact on JVM bootstrap time, since iteration over SetN/Set12s are done intensively during module bootstrap.

      Possible improvements include:

      SetNIterator: move while loop to a leaf method to reduce method calls, while hoisting the SALT test from the loop
      Set12: move SALT branch to iterator constructor, which makes the next() method smaller, faster and with fewer branches

            Assignee:
            Claes Redestad
            Reporter:
            Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: