Profile Static Method
Profiling of static methods is based on the ReSharper's 'run configurations' feature. This feature gives you an ability to create a number of predefined configurations with different run parameters for your startup project, an arbitrary executable, or even any static method. As dotTrace shares the ReSharper platform, it is able to profile any run configuration including the ones for static methods.
To profile a static method run configuration
- Open your solution in Visual Studio.
- Open the file containing a static method you want to profile.
- Open the action list for the method by placing cursor on the method and pressing Alt+Enter.
- In the list, select Performance Profiler window. To change the profiling type, open the window using the menu and select the required profiling type in the drop-down list. . Note that this session will use the profiling type that is currently selected in the
- Specify run configuration parameters and click Execute to start profiling or Save and Execute to save this run configuration and start profiling.
- The profiled method will be run under a special JetLauncher process. After the method finishes working, the process will offer you to press any key. This will end the process and take a snapshot.
- Analyze the collected snapshot either in the Performance Viewer or Timeline Viewer (depends on the profiling type you select).