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

Redundant computation in ObservableList

    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.

      1. Test.java
        0.7 kB
        Monika Dhok
      2. ObservableList.patch
        0.4 kB
        Monika Dhok

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user jwagenleitner opened a pull request:

          https://github.com/apache/groovy/pull/314

          GROOVY-7783 - Redundant computation in ObservableList

          Patch provided thanks to Monika Dhok.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/jwagenleitner/groovy GROOVY-7783

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/groovy/pull/314.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #314


          commit b20eaafa82d9ed70995c47ddbb449ed7c081a66f
          Author: John Wagenleitner <jwagenleitner@apache.org>
          Date: 2016-04-17T23:48:25Z

          GROOVY-7783 - Redundant computation in ObservableList

          Patch provided thanks to Monika Dhok.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user jwagenleitner opened a pull request: https://github.com/apache/groovy/pull/314 GROOVY-7783 - Redundant computation in ObservableList Patch provided thanks to Monika Dhok. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jwagenleitner/groovy GROOVY-7783 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/314.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #314 commit b20eaafa82d9ed70995c47ddbb449ed7c081a66f Author: John Wagenleitner <jwagenleitner@apache.org> Date: 2016-04-17T23:48:25Z GROOVY-7783 - Redundant computation in ObservableList Patch provided thanks to Monika Dhok.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/groovy/pull/314

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/314
          Hide
          jwagenleitner John Wagenleitner added a comment -

          Thanks for providing the patch, a slightly modified version was applied to both the removeAll and retainAll methods. I have cloned this to create an issue for fixing ObservableSet as well.

          Show
          jwagenleitner John Wagenleitner added a comment - Thanks for providing the patch, a slightly modified version was applied to both the removeAll and retainAll methods. I have cloned this to create an issue for fixing ObservableSet as well.

            People

            • Assignee:
              jwagenleitner John Wagenleitner
              Reporter:
              monikadhok Monika Dhok
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development