No announcement yet.

Poor mans profiling

  • Filter
  • Time
  • Show
Clear All
new posts

  • Poor mans profiling

    Recently I came into a performance issue with a C# plugin I am writing for AutoCAD. Typically one would track down these issues with a profiler, but because I'm Visual studio Express 2012 (for current CAD templates) I could not get any profiler to recognize my environment.

    So, as a poor mans profiler I would simply run the code and pause it every few seconds in Visual Studios to see what portion of the code is being ran multiple times, or where the code is hanging. After tracking it back to what was actually calling the sub it typically paused i was able to use a cached copy of the data and cut operation time from around a minute to under 5 seconds.

    Does any one else have a similar trick that may be useful to others new to development?

  • #2
    Yep, it's a simple technique but works, provided that there is a single big function that takes up a lot of time. If your program is large and complex, there may be a few functions that take a big share of the computing time together. Once you've reached that point, if you cannot use a profiler, all you can do is begin inserting timer calls and actually measure.