title: Getting around performance issues for object type evaluations (Scripting.Dictionary)
body: <p>I stumbled on a significant performance issue when I tried to optimize my code. What I found out is that TypeName(object) is extremely slow for some type of objects. As an example, running TypeName of a variant with the following types took the following time as measured by <a href="https://stackoverflow.com/questions/69285745/is-there-a-generic-benchmarking-code-that-can-be-used-to-pin-down-performance-ho">this</a> benchmarking module.</p>
  <ul>
  <li>0.3 µs for Double</li>
  <li>402 µs for Scripting.Dictionary</li>
  <li>1.3 µs for Scripting.FilesystemObject</li>
  <li>1.0 µs for Collection</li>
  </ul>
  <p>Thus running TypeName for a Scripting.Dictionary object takes a significant time. In a loop, using this 2000 times will take almost 1 second!</p>