You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Ken Geis (JIRA)" <ji...@apache.org> on 2015/12/04 21:24:11 UTC

[jira] [Commented] (GROOVY-5764) minus() method on Sets having performance issues

    [ https://issues.apache.org/jira/browse/GROOVY-5764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15042176#comment-15042176 ] 

Ken Geis commented on GROOVY-5764:
----------------------------------

I'm surprised this was closed. I just ran across it in 2.4.5. I have two sets with ~125K strings in them, and it was just not returning. I assumed that Groovy was hung, not just slow at this.

> minus() method on Sets having performance issues
> ------------------------------------------------
>
>                 Key: GROOVY-5764
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5764
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>            Reporter: Jason Gritman
>            Assignee: Jochen Theodorou
>
> After upgrading to our project from Grails 1.3.7 to 2.1.1 (Groovy 1.7.8 to 1.8.8) we started having performance issues with minus() calls on large sets. See https://github.com/jgritman/asgard/commit/09d47ddbb872b05d8e02f61ca789c8a6605622ae for the the fix that resolved our problems.
> I've also reproduced the issue in Groovy console using the following script, which compares Groovy to Guava:
> {code}
> @Grab(group='com.google.guava', module='guava', version='13.0.1')
> import com.google.common.collect.Sets
> def set1 = new HashSet(10000)
> 10000.times {
>     set1 << it as String
> }
> def set2 = new HashSet(5000) 
> 5000.times {
>     set2 << it as String
> }
> def startTime = System.currentTimeMillis()
> def result = Sets.difference(set1, set2).immutableCopy()
> println "Guava took ${System.currentTimeMillis() - startTime}"
> startTime = System.currentTimeMillis()
> result = set1 - set2
> println "Groovy took ${System.currentTimeMillis() - startTime}"
> {code}
> The output was: 
> {code}
> Guava took 3
> Groovy took 682
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)