title: GroupBy performs slowly
body: <p>I have the following query and is super slow for 3000 records and produces 370 entries. How can I improve performance on it?</p>
  
  <pre><code>dealerResults = _results.GroupBy(x =&gt; new { x.DealerName, x.DealerId })
                                        .Select(x =&gt; new MarketingReportResults()
                                        {
                                            DealerId = x.Key.DealerId,
                                            DealerName = x.Key.DealerName,
                                            LinkedTotal = linkedLeadCores.Count(y =&gt; y.DealerId == x.Key.DealerId),
                                            LeadsTotal = x.Count(),
                                            SalesTotal = x.Count(y =&gt; y.IsSold),
                                            Percent = (decimal)(x.Count() * 100) / count,
                                            ActiveTotal = x.Count(y =&gt; y.IsActive),
                                        }).ToList();
  </code></pre>