Archive for the ‘dotTrace Tips&Tricks’ Category

Tales from the Development Crypt: Snapshooting 450GB

Wednesday, April 15th, 2009

We have recently crossed the bounds of our specialization to set a world record in data transfer rate by throwing a 450GB file from one machine to another in only 1 minute! It was surprisingly easy: all we had to do was find a fast-running developer and equip the guy with an HDD!
Fake world records aside, only 4 months since our previous milestone, we’ve collected and successfully opened a 450GB snapshot. We mean it. Anyone ever seen a .NET profiler lifting that much weight?

Tales from the Development Crypt: What If…

Friday, January 16th, 2009

Sometimes during profiling sessions you notice that your application is running slow or hanging, only to realize that you have not turned off a debug switch. After that, you have to reprofile everything.
Other times, after hours of continuous profiling, you optimize a consuming method, and again, you have to start from scratch to see if the optimization actually worked.
We thought we could provide a less time-consuming option for scenarios like these.
Starting from version 4.0, dotTrace will be able to recalculate a snapshot without reprofiling your application. Just ask “what if this function is removed” or “what if I optimize this function by 40%” and get a prompt answer from dotTrace: it will display new time values and compare them to the old ones.

Tales from the Development Crypt: How a dotTrace Alpha Helped ReSharper Beta

Wednesday, December 24th, 2008

Back in the days when R# 4.0 was still in the making, we were profiling it heavily in order to, you know, make sure it wouldn’t suck all your hardware resources out. Time and again we were getting thousands and thousands of threads accumulated in snapshots. Obviously, merging them was a real challenge.
Why, we thought, couldn’t R# guys be more accurate with threads, and wondered whether we would ever get a complete snapshot.
The thread exuberance issue in R# was eventually solved, but you know what? Even before that happened, dotTrace had never ever gone crazy profiling the Most Intelligent Tool for Visual Studio.
The message is: whenever you have a zillion threads in your application, it’s not a problem for dotTrace - it’s a problem for you.

Tales from the Development Crypt: Going Full Speed Ahead

Wednesday, November 26th, 2008

We just opened an 80Gb performance snapshot. It took dotTrace only 34 seconds after launch to show the call stack!

The downside: no more coffee breaks while snapshots are being opened!

Tales from the Development Crypt: dotTrace Paradigm Shift

Thursday, November 6th, 2008

Everybody knows that profilers throw OutOfMemoryException’s during multihour sessions with fatty applications. It’s just as certain as death, taxes and beer, isn’t it?

Well, the new version of dotTrace will apparently go its own way: profiler core now prefers InsufficientDiskSpaceException’s.

Yes, you got it right — we’ve improved dotTrace to handle tens and even hundreds of gigabytes of monitored data without running out of memory. Now only your hard drive is the limit!

Folder Substitution Management in dotTrace

Friday, August 8th, 2008

The source view provided by dotTrace lets you quickly analyze source code and spot its problem areas without switching to another application.

However, when you build your applications using a server-based build tool such as, for example, TeamCity, and then start analyzing your local copy of the application, working with the source view can be tricky. The paths defined in the .pdb file built at a server usually cannot be used locally on your machine. In that case dotTrace will inform you that it cannot find the necessary source files.

The Folder Substitution Management feature provided by dotTrace lets you define folder mappings for application sources and effectively work with the project source files, no matter where they are located.

When the tool fails to find a source file using the current settings from the .pdb file, you are offered to locate it manually:

Source Code is Unavailable

Click the browse… link in the source view and locate the folder, where you know your local copies of the source files reside. As soon as you locate the root folder, the tool will scan the entire subtree and display the list of source files relevant to the function you are examining at the moment:

File Matching Feature of dotTrace

Just click the matching file link, to view the source.

DotTrace has now extracted the common base path and automatically created the folder mapping pattern. This pattern is automatically applied every time, when displaying this application’s source code.

You might occasionally come across a situation, when different parts of your application’s source code reside under different roots. This is the case to use several custom folder mappings.

To view the existing folder substitutions or create new ones, select View | Manage Folder Substitutions (Ctrl+Alt+S):

DotTrace\\\'s Folder Substitutions Dialog

Use this dialog to add, remove, edit and rearrange any custom folder substitutions you might need.

The dotTrace’s folder substitutions feature lets you work with your application’s source code even more smoothly.

Technorati tags: , , , ,

Snapshot Comparison in dotTrace

Thursday, July 17th, 2008

dotTrace lets you spot problem portions of code with great ease and accuracy. Once all major bottlenecks are located, you can start eliminating these bottlenecks.

After you apply certain optimization effort, it would be nice to compare the performance of your application before and after the optimization.

dotTrace provides a useful feature that lets you assess the results of optimization with great precision. The feature’s called snapshot comparison.

Let’s see how it works.

It is assumed that you have saved the first snapshot (before optimization). Then you do some work on the application to optimize its bottlenecks.

To see the results of optimization, perform the following steps:

  • Open the first snapshot (before optimization) in dotTrace.
  • Profile your application once again to get a snapshot of the application after the optimization.
  • Once the second snapshot is loaded, either choose Tools | Compare CPU Tabs on the main menu or click the Compare CPU Tabs button on the main toolbar.


dotTrace will now load the comparison snapshot. It looks like a regular snapshot but compares two states of the same application. Consider the comparison snapshot of the sample application that comes bundled with dotTrace:

dotTrace Snapshot Comparison

It compares two working modes of the sample application. The first snapshot was taken in the slow mode, the second one in the fast mode.

The comparison snapshot offers a straightforward color-coding scheme: everything rendered green represents performance enhancements, everything red represents performance decreases.

While navigating the snapshot’s call tree, you can always get a precise indication on how much faster (or maybe slower) certain methods have become.
 

For each and every method you get a numerical representation of the performance enhancements. You can examine fluctuations in the following three parameters: relative change in time consumed (%), absolute change in time consumed (ms) and change in the number of calls.

Any number of custom filters can be applied to the comparison snapshot just like to a regular one. It helps you to exclude from view those items that are really of no interest to you in terms of performance alterations.

All the useful call tree navigation features are available here as well. Use To Next/Previous Unfiltered Node (Ctrl+Right/Left) and To Next/Previous Important Node (Shift+Ctrl+Right/Left) as much as you like.

Snapshot comparison is the ultimate way to assess the results of optimization and get a precise representation of the bottleneck elimination efforts.

Technorati tags: , , , , ,

dotTrace Call Tree: Smart Navigation

Thursday, July 10th, 2008

Usually, when profiling applications, you have to analyze the call tree. This part of the job is the most tedious: digging through the endless sequences of nodes distracts you from focusing on real problem areas. With dotTrace smart navigation, this task becomes much easier. Let’s see how it works, using the sample application that comes bundled with dotTrace.
 
In order to investigate the application’s behavior and spot potential candidates for optimization you usually navigate the call tree with a mouse or arrow keys.

 
dotTrace Call Tree

 
You are presented with the data on relative and exact timings as well as number of calls to particular methods. Percentage of time consumed by the method in relation to the thread’s root can be used here as a bottleneck signal. With the help of these concise but precise data we can find out who is the major time consumer in our case: the SetClip method.
 
As you can see, some calls are marked gray and sort of dimmed out in the GUI. Those are calls to filtered methods. By default, only system calls are filtered (Microsoft.*, System.*). However, dotTrace lets you apply any number of custom filters (View | Filters | Manage Filters… or Ctrl+Alt+F). This can be very helpful if you have little or no interest in investigating behavior of some functions (perhaps, because they can’t really be optimized).
 
To exclude filtered items completely from navigation process there is a pair of commands in the View menu which are also available through shortcuts: To Next/Previous Unfiltered Node (Ctrl+Right/Ctrl+Left) bypasses all filtered calls in the process of navigation.
 
Another pair of commands is To Next/Previous Important Node (Shift+Ctrl+Right/Shift+Ctrl+Left). It offers you the possibility to get from the initial ‘grouped by thread’ state right to the next method which can be of interest from practical perspective. The view becomes completely unfolded with the necessary item highlighted. All that can be done with the help of a single menu command or a handy shortcut:

 
dotTrace: To Next Important Node

 
When performing navigation between important nodes dotTrace goes down the call tree until it finds a node having two or more child nodes, each of which consumes at least 10 percent of the overall runtime. Selected becomes the child, which consumed the largest amount of time in comparison to other children.
 
Navigation between important nodes can be a tremendous timesaver, indeed!

Technorati tags: , , , , ,

dotTrace Flash Movies Now Available

Thursday, February 15th, 2007

We’ve released several short flash movies demonstrating how to profile using dotTrace. They are available right now in the dotTrace Docs and Demos section.

For quicker access, here is some short info about each movie and a quick link:

Performance profiling


Memory profiling

  • Dump memory mode
    Shows the mechanics of profiling memory usage of an app and getting a “dump memory” snapshot. Also illustrates working with memory snapshots. View online (5 minutes long) or Download (0.88 MB).
  • Memory difference mode
    Shows the more advanced profiling option - capturing snapshots in “memory difference mode.” As a result, you can see the difference between application memory states. Also explains how to profile garbage collection operations. View online (5 minutes long) or Download (0.99 MB).


Your feedback and comments are welcome here at the blog and at tips@jetbrains.com :)

Technorati tags: , , , , , ,

What Is the Deal with Memory Difference Mode?

Thursday, November 23rd, 2006

dotTrace 2.0 offers two different ways to profile memory. Each of them is useful for a particular type of profiling tasks, described below.

Dump Memory Mode

You can dump memory at any given time to see what’s in it. This is good for checking whether certain objects are allocated in memory if they are supposed to (or not supposed to), and whether they consume as little memory as they should.

Here’s how you do that:

  1. Start the application for profiling
  2. At any time, click the Dump Memory button on the Control Profiling dialog to generate a snapshot:

    Control Profiling dialog - Dump Memory button


Memory Difference Mode

This lets you check the difference between two application memory states. It’s a good way to profile a certain feature or action in your application. For example, you can have the application open a file and close it, and then see whether all objects associated with the opened file have been properly disposed of. For this, you need to mark the first point in time (”Point A”), let the application do something, then mark the second point (”Point B”). A memory snapshot generated in this way will contain all data related to the memory differences between Point A and Point B.

Here’s how you do that:

  1. Start the application for profiling
  2. At any time, click Mark Memory on the Control Profiling dialog to mark Point A
  3. In the profiled application, perform the action that takes you from Point A to Point B
  4. Click Get Snapshot to mark Point B and generate a snapshot:

    Memory Difference mode - Get Snapshot button
  5. If you want to return to regular profiling mode (no snapshot generation), click Drop Snapshot


In both of these modes, the profiled application continues to run after a snapshot is taken. You are free to combine profiling in the dump memory mode and the memory difference mode as your profiling needs require.

Technorati tags: , ,