title: fwrite chokes on "<?xml version"
body: <p>When the string <code>&lt;?xml version</code> is written to a file via fwrite, the subsequent writing operations become slower.</p>
  
  <p>This code :</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;ctime&gt;
  #include &lt;iostream&gt;
  
  int main()
  {
      const long index(15000000); 
  
      clock_t start_time(clock());
      FILE*  file_stream1 = fopen("test1.txt","wb");
      fwrite("&lt;?xml version",1,13,file_stream1);
      for(auto i = 1;i &lt; index ;++i)
          fwrite("only 6",1,6,file_stream1);
      fclose(file_stream1);
  
      std::cout &lt;&lt; "\nOperation 1 took : " 
          &lt;&lt; static_cast&lt;double&gt;(clock() - start_time)/CLOCKS_PER_SEC 
          &lt;&lt; " seconds.";
  
  
      start_time = clock();
      FILE*  file_stream2 = fopen("test2.txt","wb");
      fwrite("&lt;?xml versioX",1,13,file_stream2);
      for(auto i = 1;i &lt; index ;++i)
          fwrite("only 6",1,6,file_stream2);
      fclose(file_stream2);
  
      std::cout &lt;&lt; "\nOperation 2 took : " 
          &lt;&lt; static_cast&lt;double&gt;(clock() - start_time)/CLOCKS_PER_SEC 
          &lt;&lt; " seconds.";
  
  
      start_time = clock();
      FILE*  file_stream3 = fopen("test3.txt","w");
      const char test_str3[] = "&lt;?xml versioX";
      for(auto i = 1;i &lt; index ;++i)
          fwrite(test_str3,1,13,file_stream3);
      fclose(file_stream3);
  
      std::cout &lt;&lt; "\nOperation 3 took : " 
          &lt;&lt; static_cast&lt;double&gt;(clock() - start_time)/CLOCKS_PER_SEC 
          &lt;&lt; " seconds.\n";
  
      return 0;
  }
  </code></pre>
  
  <p>Gives me this result :</p>
  
  <pre><code>Operation 1 took : 3.185 seconds.
  Operation 2 took : 2.025 seconds.
  Operation 3 took : 2.992 seconds.
  </code></pre>
  
  <p>That is when we replace the string <code>"&lt;?xml version"</code> (operation 1) with <code>"&lt;?xml versioX"</code> (operation 2) the result is significantly faster. The third operation is as fast as the first though it's writing twice more characters.   </p>
  
  <p>Can anyone reproduce this?</p>
  
  <p>Windows 7, 32bit, MSVC 2010 </p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>After R.. suggestion,  disabling Microsoft Security Essentials restores normal behavior.</p>