Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7822

Redundant computation in ObservableSet

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.6
    • Fix Version/s: 2.4.7
    • Component/s: groovy-runtime
    • Labels:
      None
    • Flags:
      Patch

      Description

      There appears to be redundant computaions in "ObservableList.retainAll"
      methods in version 2.4.6. I have attached a test and proposed a small
      patch which ensures that "contains" method is called on hashset of
      input collection. This patch gives 1739X speed up on my
      machine for the provided test.

      Also, one more possibility to fix the issue is by using TreeSet as suggested in
      https://issues.apache.org/jira/browse/GROOVY-5739 as well.
      Similar patches can be applied for three other methods, ObservableList.removeAll, ObservableSet.retainAll, ObservableSet.removeAll.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jwagenleitner John Wagenleitner
                Reporter:
                jwagenleitner John Wagenleitner
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: