UsersGuide:Chapter 12:Profiling your Project

From Real Software Documentation

Jump to: navigation, search

Profiling Your Project

The Profiler is a service that monitors the built application while it is running. It measures the amount of time spent in each method, and it also reports how many times the method is called. With the Profiler, you can track down performance issues within your applications quickly without any additional coding.

The Profiler is available only in the Enterprise version of Real Studio. To use the Profiler you must enable it via the Project menu. Choose Project ↠ Profile Code to enable the Profiler. When enabled, a checkmark appears to the left of the menu item. If you don’t have the Enterprise version of Real Studio, this menu command is not available.

Enabling the Profiler.

Once the Profile Code menu item is checked, the Profiler will automatically profile any debug application or build. Only code that is actually executed is profiled, and only user-written methods will be profiled, not built-in methods.

Since the Profiler is an integrated feature of the IDE, the profile data that is gathered will be formatted and presented in the IDE when you debug your application. You have the option to also save this profile data in HTML or CSV (comma separated values) format. A “No Profile Data Was Gathered” error can occur if you are Remote Debugging (this is not yet supported), or if the debugging session ends prematurely. The application must exit properly for the Profiler to gather its data.

When you quit out of the debugger, the Profile screen appears. You can use the Expand Rows item to expand all the items in the profile or expand them individually.

The initial view of a profile.

The expanded view of an item lists all the methods belonging to the item and reports the number of calls, the total execution time, and the average time.

An expanded view of a profile.

Click the Save Profile button in the Profiler toolbar to save the profile to disk in either HTML or CSV (comma separated values) formats.

The Profiler feature also works when you build your application. In this mode the Profiler is compiled into your built application. When your application finishes executing, the profile is saved in CSV format as “Profile.txt” in the same directory as your application. The application must exit properly for the Profiler to generate this file.


Personal tools