Issues.00204 - lordmundi/wikidoctest GitHub Wiki

00204: performance profiler troubleshooting tool

« 00203 | Issues | 00205 »

Summary: performance profiler troubleshooting tool

Created: 2009–11–20 12:53

Status: Released

Category: Request

From: frankie

Version: 2.0

Released_In: 2.4

Description:

many times, scripts or plugins can destroy performance through inefficient operation… it would be great boost for developers and integrators if there was a way to see what impact on performance tcl scripts (or maybe tcl routines since most of the calls are via callbacks) have, and also what impact on performance plugins have.

For example, a profiler report might include a breakdown of how many milliseconds each tcl procedure is taking (or maybe the top 100 or so) along with stats showing how much time plugin/C-routines are taking. There are industry profilers, and maybe these would do what I want, but it requires recompile flags I believe, and will also pick up calls to many things we would want to ignore (such as openGL stuff or libary calls). This way we could explicitly break out tcl procedures and plugin functions regardless of compile state and language.


Comments

frankie May 17, 2013, at 03:39 PM: This has been added, although not to the same extents as the original issue requested. But, the profiler will give a breakdown of where the time is being spent every frame. It will show major portions of the DOUG main loop, including Tcl events, Tcl callbacks, and each plugin. Furthermore, you can add profile tracking to any section of code in a plugin by just wrapping it with a "START_TIMING" and "STOP_TIMING" callback. See the following code block for an example. The times for these custom loops will automatically be subtracted out for the time for the plugin, so that number will represent the time for the code not contained in your custom time blocks.

START_TIMING("trail.update");

    for( ii = 0; ii < NUM_INTERNAL_TRAILS; ii++ )
    {
        DSP_UpdateInternalTrails(ii);
    }

STOP_TIMING("trail.update");

To use, simply run with the "-timing" command line option. Timings will be printed out on exit. Also, you can examine the times at run-time by running the tcl command "doug.cmd print_timings" in the command console. Also, if you want to change something and see the effect on the timing, you can reset all the timing by running "doug.cmd reset_timings". To see it in action, watch the video at this link. You may have to right click and save it first, then play it with something like VLC.


« 00203 | Issues | 00205 »

Associated Commits

| commit | e5ae6b793ad191223a7c9cdc6a57aa22f027beff link6 | || | Author: | Frank Graffagnino | | Date: | Mon Oct 6 16:32:05 2014 -0500 | | Message: | [@Issue 50330 and 00204: Fixed segfault when timings are printed without -timing option @] |

Affected Files:

bin_Darwin/doug              | Bin 1858832 -> 1859148 bytes
 bin_Linux_FC3/doug           | Bin 671222 -> 672095 bytes
 bin_Win32/doug.exe           | Bin 1847023 -> 1851741 bytes
 lib_Darwin/libdsp.a          | Bin 2026496 -> 2026496 bytes
 lib_Darwin/libviewer.a       | Bin 1239992 -> 1240336 bytes
 lib_Linux_FC3/libdsp.a       | Bin 1020878 -> 1020922 bytes
 lib_Linux_FC3/libdsp_s.so    | Bin 853724 -> 853796 bytes
 lib_Linux_FC3/libviewer.a    | Bin 1097020 -> 1097496 bytes
 lib_Linux_FC3/libviewer_s.so | Bin 919301 -> 919485 bytes
 lib_Win32/libdsp.dll         | Bin 2440633 -> 2488761 bytes
 lib_Win32/libviewer.dll      | Bin 2405746 -> 2382194 bytes
 11 files changed, 0 insertions(+), 0 deletions(-)

| commit | f6aef9f8231560efc631bff576b48c8284cc5873 link7 | || | Author: | Frank Graffagnino | | Date: | Fri May 17 15:19:25 2013 -0500 | | Message: | [@Issue 00204: New profiler timing capability To use, run with -timing. While running, you can send the tcl command "doug.cmd print_timings" to see the current profile, or you can see it when you exit doug.

Also, to reset the timings during runtime, call "doug.cmd reset_timings".

I also went ahead and updated the include files in src.dist/includes @] |

Affected Files:

bin_Darwin/doug                       | Bin 1849072 -> 1858832 bytes
 bin_Linux_FC3/doug                    | Bin 667860 -> 671222 bytes
 bin_Win32/doug.exe                    | Bin 1843259 -> 1847023 bytes
 lib_Darwin/libdsp.a                   | Bin 977496 -> 988888 bytes
 lib_Darwin/libviewer.a                | Bin 1217680 -> 1239992 bytes
 lib_Linux_FC3/libdsp.a                | Bin 1001496 -> 1020718 bytes
 lib_Linux_FC3/libdsp_s.so             | Bin 838398 -> 853664 bytes
 lib_Linux_FC3/libviewer.a             | Bin 1080108 -> 1097020 bytes
 lib_Linux_FC3/libviewer_s.so          | Bin 911309 -> 919301 bytes
 lib_Win32/libdsp.dll                  | Bin 2444307 -> 2451385 bytes
 lib_Win32/libviewer.dll               | Bin 2380428 -> 2405746 bytes
 src.dist/includes/d_comm.h            |   5 &plusmn;-
 src.dist/includes/doug.h              |  23 +++++++++++&plusmn;
 src.dist/includes/dsp.h               |   5 +&plusmn;
 src.dist/includes/dsp_defs.h          |   3 ++
 src.dist/includes/dsp_double.h        |   5 +++
 src.dist/includes/dsp_globals.h       |   9 +++++
 src.dist/includes/dsp_macros.h        |  14 ++++++++
 src.dist/includes/dsp_protos.h        |  13 +++++++
 src.dist/includes/dsp_structs.h       |  63 +++++++++++++++++++++++++++++++&plusmn;-
 src.dist/includes/tcl.h               |   2 &plusmn;
 src.dist/includes/tcl8.5.8.h          |   2 &plusmn;
 src.dist/includes/tclDecls.h          |   2 &plusmn;
 src.dist/includes/tclDecls8.5.8.h     |   2 &plusmn;
 src.dist/includes/tclPlatDecls.h      |   2 &plusmn;
 src.dist/includes/tclPlatDecls8.5.8.h |   2 &plusmn;
 src.dist/includes/tk.h                |   2 &plusmn;
 src.dist/includes/tk8.5.8.h           |   2 &plusmn;
 src.dist/includes/tkDecls.h           |   2 &plusmn;
 src.dist/includes/tkDecls8.5.8.h      |   2 &plusmn;
 src.dist/includes/tkInt8.5.8.h        |   2 &plusmn;
 src.dist/includes/tkIntDecls8.5.8.h   |   2 &plusmn;
 32 files changed, 143 insertions(+), 21 deletions(-)