title: Xml serializer very slow for unknown reason
body: <p>I experience a very strange behaviour of my application. We are working with xml based data which is persisted as xml into files. For unknown reasons the deserialization suddenly is very slow and I tried to figure out what the problem is.</p>
  
  <p>I had a look at the performance of a file which is has 6MB of size. I logged the deserialization time from the point where the deserialization starts:</p>
  
  <ul>
  <li>whithin our main application it takes about 6 seconds</li>
  <li>using the exact same deserialization code in a sample application takes 168ms</li>
  </ul>
  
  <p>Both using the same .net framework version. I do not understand why it performs that slow. I also did a trace and discovered that the issue is really the .net code:</p>
  
  <p><a href="https://i.stack.imgur.com/hyzFO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hyzFO.png" alt="enter image description here"></a></p>
  
  <p>I can reproduce this very reliably over and over again.</p>
  
  <p>What am I missing?</p>