title: Performance issue with Groovy lists / maps
body: <p>I have this code which compares two lists and find differences, so far so good, it works fine for small lists. Now Im testing with huge lists.
  which contains <strong>both</strong> more than <strong>300000</strong> maps. It takes more than <strong>5 hours</strong> to process it. is that normal? How can I reduce the procssing time?</p>
  
  <pre><code>def list1 = [
      [cuInfo:"T12",service:"3",startDate:"14-01-16 13:22",appId:"G12355"],
      [cuInfo:"T13",service:"3",startDate:"12-02-16 13:00",appId:"G12356"],
      [cuInfo:"T14",service:"9",startDate:"10-01-16 11:20",appId:"G12300"], 
      [cuInfo:"T15",service:"10",startDate:"26-02-16 10:20",appId:"G12999"]
  ]
  ​
  def list2 = [
      [name:"testname1",cuInfo:"T12",service:"3",startDate:"14-02-16 10:00",appId:"G12351"],
      [name:"testname1",cuInfo:"T13",service:"3",startDate:"14-01-16 13:00",appId:"G12352"],
      [name:"testname1",cuInfo:"T16",service:"3",startDate:"14-01-16 13:00",appId:"G12353"],
      [name:"testname2",cuInfo:"T14",service:"9",startDate:"10-01-16 11:20",appId:"G12301"], 
      [name:"testname3",cuInfo:"T15",service:"10",startDate:"26-02-16 10:20",appId:"G12999"],
      [name:"testname3",cuInfo:"T18",service:"10",startDate:"26-02-16 10:20",appId:"G12999"]  
  ]
  
  def m1 = [:]
  def m2 = [:]
  def rows = list1.collect { me -&gt; 
      [me, list2.find { it.cuInfo == me.cuInfo &amp;&amp; it.service == me.service }] 
  }.findAll {
              it[1]
  }.findAll { 
      /*
       * This is where the differences are identified.
       * The 'name' attribute is excluded from the comparison,
       * by including only the desired attributes.
       */
      it[0] != it[1].subMap(['cuInfo', 'service', 'startDate', 'appId'])
  }.collect {
      /*
       * At this point the list only contains the row pairs
       * which are different. This step identifies which columns
       * are different using asterisks.
       */
      (m1, m2) = it
      m1.keySet().each { key -&gt;
          if(m1[key] != m2[key]) {
              m1[key] = "*${m1[key]}*"
              m2[key] = "*${m2[key]}*"
          }          
  }
  
                  [m1, m2]
              }.collect {
      [it[0].values(), it[1].values()].flatten() as String[]
  }
  </code></pre>