Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語 -

Please note that the recommended version of Scilab is 6.0.2. This page might be outdated.
However, this page did not exist in the previous stable version.

Scilab help >> Функции > profiling > profile

profile

extract execution profiles of a Scilab function

Calling Sequence

c=profile(fun)

Arguments

fun

a Scilab function

c

a nx3 matrix containig the execution profiles

Description

To use profile, profiling instructions need to be added to the Scilab function function by add_profiling.

For such function, When such a function is executed the systems counts how many time each line is executed and how may cpu time is spend for each line execution. These data are stored within the function data structure. The profile function allows to extract these data and return them in the two first columns of c. The c third column gives a measure of interpetor effort for one execution of corresponding line. Ith line of c corresponds to Ith line of the function (included first)

Note that, due to the precision of the processor clock (typically one micro second), some executed lines may appear with 0 cpu time even if total cpu time really spend in their execution is large.

Examples

function x=foo(a, n)
 x=0;
 for i=1:n
   if x<10 then
     x=x+a
   else
     x=x+1
   end
 end
 x=x^2+1
endfunction

add_profiling("foo")
foo(0.1,100) //run the function
profile(foo) //extract profile information

See Also

  • add_profiling — Adds profiling instructions to a function.
  • deff — on-line definition of function
  • plotprofile — extracts and displays execution profiles of a Scilab function
  • showprofile — extracts and displays execution profiles of a Scilab function
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:37:58 CEST 2013