title: WPF performance issue due to UI Automation
body: <p>I'm experiencing an issue described in <a href="http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110" rel="noreferrer">this thread</a>. </p>
  
  <p>dotTrace told me "Stylus Input" was guilty.
  <img src="https://i.stack.imgur.com/TERLl.png" alt="enter image description here"></p>
  
  <p>I tried <a href="http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110" rel="noreferrer">the code</a> posted by <a href="http://social.msdn.microsoft.com/profile/ron%20z/?type=forum&amp;referrer=http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110" rel="noreferrer">Ron Z</a> and <a href="http://social.msdn.microsoft.com/profile/chaim%20zonnenberg/" rel="noreferrer">Chaim Zonnenberg</a>, but didn't work.</p>
  
  <p><a href="http://social.msdn.microsoft.com/profile/rath%5Bmsft%5D/" rel="noreferrer">Rash</a> suggested 2 workarounds:</p>
  
  <ol>
  <li><p>Automation code will be triggered only if there are any automation clients ( like screen reader, tabtip in tablet pcs, etc) running in the machine. So one way to get out of this situation is to close any of those automation client apps.</p></li>
  <li><p>If one is not feasible then an alternative is,  UIElementHelper.InvalidateAutomationAncestors  will take longer time only if automation tree for the app is sparse ( happens if had disabled building automation tree using custom window automation peer) and visual tree is dense. So another solution is disable any custom automation code and allow WPF to build complete automation tree. This should speed up UIElementHelper.InvalidateAutomationAncestors as well.</p></li>
  </ol>
  
  <p>But how to close tabtip? I tried to stop and disable the following services but didn't work, tabtip.exe was still running in the background:</p>
  
  <ul>
  <li>Tablet PC Input Service</li>
  <li>TabletServicePen</li>
  </ul>
  
  <p>Rash said this issue should be solved in .NET 4.0 SP1. Anyone knows the release date of .NET 4.0 SP1?</p>
  
  <p>I'm using Visual Studio 2010, Windows 7 64bit, Wacom Graphire 4.</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p><strong>Update</strong>:</p>
  
  <p>To close tabtip.exe I just need to restart Windows after disabling the aforementioned services. But this alone didn't solve my issue. In order to workaround the performance issue, I have to also disable "Wacom Consumer Touch Service".</p>
  
  <p>And according to <a href="http://social.msdn.microsoft.com/Forums/is/wpf/thread/d6e71f13-d7ac-44f2-8c21-af52b9fe2bc3" rel="noreferrer">this thread</a> (March 22, 2011):</p>
  
  <p><code>there is no published timeline for .NET Framework 4.0 sp1</code></p>