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

Make ObservableArrays to grow as ObservableLists

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Subcomponent:

      Description

      It was designed that way that ObservableArrays grow to match the requested size. So if you are doing many add operations, for example, add 3 floats per point for each point, you get number of point array resizes and data copying which is highly insufficient.

      Although you can avoid this using ensureCapacity() methods there is still a big chance people would rely on past experience with ObservableList and never invoke it but rather blame ObservableArrays for being very inefficient.

      I already saw code that was adding small chunks of information to ObservableArray without ensureCapacity() in the beginning. It looks like a common mistake and we should avoid this.

      So I propose change growing of internal array of ObservableArray to match ObservableList strategy

        Attachments

          Activity

            People

            • Assignee:
              mrkam Alexander Kuznetcov (Inactive)
              Reporter:
              mrkam Alexander Kuznetcov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: