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

Preserve SIZED characteristics on slice operations (skip, limit)

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:
      None

      Description

      Currently, skip() and limit() operations do not preserve the SIZED characteristics in sequential streams. As a result, having skip() or limit() in sequential stream, makes operations like toArray(), toList() and count() working slower and producing more garbage than necessary. It's possible to keep the SIZED characteristics if we can adjust the size reported by an original spliterator.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tvaleev Tagir Valeev
              Reporter:
              tvaleev Tagir Valeev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: