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.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user jwagenleitner opened a pull request:

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

          GROOVY-7822 - Redundant computation in ObservableSet

          Related to PR #314, performance significantly improved for `retainAll`, similar change to `removeAll` did not yield any significant performance difference.

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

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

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

          https://github.com/apache/groovy/pull/316.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 #316


          commit 459a141bf4f558e3340c8df3c125b540a49fa9d4
          Author: John Wagenleitner <jwagenleitner@apache.org>
          Date: 2016-04-21T16:17:46Z

          GROOVY-7822 - Redundant computation in ObservableSet


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user jwagenleitner opened a pull request: https://github.com/apache/groovy/pull/316 GROOVY-7822 - Redundant computation in ObservableSet Related to PR #314, performance significantly improved for `retainAll`, similar change to `removeAll` did not yield any significant performance difference. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jwagenleitner/groovy GROOVY-7822 -ObservableSet Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/316.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 #316 commit 459a141bf4f558e3340c8df3c125b540a49fa9d4 Author: John Wagenleitner <jwagenleitner@apache.org> Date: 2016-04-21T16:17:46Z GROOVY-7822 - Redundant computation in ObservableSet
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

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

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

            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:

                Development