title: LINQ Loop getting slower after some times
body: <p>I am running a code, to extract hyperlinks using regular expression from 1 million documents, at the beginning, the code run very quickly initially (about 200 docs per second) but later on it becomes very slow, as slow as 10 docs per second, does anyone experience this before? The code is below.</p>
  
  <pre><code>class Program
      {
          static void Main(string[] args)
          {
              ExtractHyperLinks();
  
          }
  
          private static void ExtractHyperLinks()
          {
              DataContext dc = new DataContext();
  
              var docs = from p in dc.docs
                         select p;
  
              Regex reUrl = new Regex(@"((https?):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&amp;]*)");
  
              int counter = 0;
  
              foreach (Document d in docs)
              {                
                  Match m = reUrl.Match(tweet.Text);
                  if (m.Success)
                  {
                      Hyperlink h = new Hyperlink();
                      h.Url = m.Value;
                      dc.Hyperlinks.InsertOnSubmit(h);
                      dc.SubmitChanges();
                      Console.WriteLine(h.Url);
                  }
                  counter++;
              }
          }
      }
  </code></pre>