title: Filter large list object on data from another large list: slow performance
body: <p>I have two large lists of object. First (about of <strong>1 000 000 objects</strong>):</p>
  
  <pre><code>public class BaseItem
  {
      public BaseItem()
      {
  
      }
  
      public double Fee { get; set; } = 0;
  
      public string Market { get; set; } = string.Empty;
  
      public string Traider { get; set; } = string.Empty;
  
      public DateTime DateUtc { get; set; } = new DateTime();
  }
  </code></pre>
  
  <p>Second (about of <strong>20 000 objects</strong>):</p>
  
  <pre><code>public class TraiderItem
  {
      public TraiderItem()
      {
  
      }
  
      public DateTime DateUtc { get; set; } = new DateTime();
  
      public string Market { get; set; } = string.Empty;
  
      public string Type { get; set; } = string.Empty;
  
      public double Price { get; set; } = 0;
  
      public double Amount { get; set; } = 0;
  
      public double Total { get; set; } = 0;
  
      public double Fee { get; set; } = 0;
  
      public string FeeCoin { get; set; } = string.Empty;
  }
  </code></pre>
  
  <p>I need to find all <code>Traider</code> items in <code>Base</code> items when <code>DateUtc</code> are equals <strong>and</strong> <code>Fee</code> are equals. Now i am using <strong>Any</strong> method:</p>
  
  <pre><code>traiderItemsInBase = traiderItems.Where(a =&gt; baseItems.Any(x =&gt; x.DateUtc == a.DateUtc &amp;&amp; Math.Round(x.Fee, 8) == Math.Round((double)a.Fee * 0.4, 8))).ToList();
  </code></pre>
  
  <p>But this way is very-very slow. Is there a way to make this more efficient?Is there possibility to use <strong>HashSet</strong> in this case?</p>