<< add_profiling profiling profile >>

removed >> removed > 5-5-2 > profiling > plotprofile

plotprofile

Displays the profiling charts of a function

Calling Sequence

plotprofile(fun)

Arguments

fun

a Scilab compiled function, or a function name (string), or an array of function names

Description

To use plotprofile on a function, the profiling of this function must have been first activated:

Once the function has been executed, calling plotprofile displays two windows, one containing the source code of the function, and a second one containing three histograms which show:

When clicking on a histogram bin, the related line is highlighted in the source code window.

Note: "Exit" item is used to exit from the "plotprofile" graphics window.

Examples

// Exemple of profiling a function
function foo()
  runs = 50;
  b = 0;
  for i = 1:runs
      b = zeros(220, 220);
      for j = 1:220
           for k = 1:220
               b(k,j) = abs(j - k) + 1;
           end
      end
  end
endfunction

// Enables the profiling of the function
add_profiling("foo");

// Executes the function
foo();

// Displays the profiling charts
plotprofile(foo) // click on Exit to exit
// Exemple of profiling a function defined with deff
deff('x = foo2(n)', ['if n > 0 then'
                    '  x = 0;'
                    '  for k = 1:n'
                    '    s = svd(rand(n, n));'
                    '    x = x + s(1);'
                    '  end'
                    'else'
                    '  x = [];'
                    'end'], ..
                 'p');

// Executes the function
foo2(200);

// Displays the profiling charts
plotprofile("foo2") // click on Exit to exit

See Also

History

VersionDescription
5.5.2 plotprofile was removed after Scilab 5.5.2.

Report an issue
<< add_profiling profiling profile >>