[Scilab-users] How to read profileGetInfo().LineCoverage results correctly?
Samuel Gougeon
sgougeon at free.fr
Thu Jan 28 14:43:42 CET 2021
Dear all,
Still about new Scilab 6 profiling capabilities:
The first so-called ""Basic example" given in the documentation of the
profiling features
@ https://help.scilab.org/docs/6.1.0/en_US/profile.html is the following:
// Function to be profiled
function x=foo(n)
if n > 0 then
x = 0;
for k = 1:n
s = svd(rand(n, n));
x = x + s(1);
end
else
x = [];
end
endfunction
// Enables the profiling of the function
profileEnable(foo);
// Executes the function
foo(200);
// Returns the function profiling results
prof = profileGetInfo();
Now, after https://help.scilab.org/docs/6.1.0/en_US/profileGetInfo.html
we can get
--> prof.LineCoverage(1)
ans =
-1. 0. // function ...
1. 0.6385544 // if ... *Why so long time ??*
1. 0.6385513 // x = 0; 638 ms for a single execution ??
1. 0.6385467 // idem
200. 1.2763477 // OK, quite expected. The strange
thing is that the "x=0" time is almost the half of this time..
200. 0.0005116 // OK, a result more understandable
than for x=0 above.
-1. 0. // OK (end for)
-1. 0. // OK (else)
0. 0. // OK : never met
-1. 0.
-1. 0.
Since it is presented as a basic example, it is likely error-proof.
So what am i missing about how to read or interpret these results ?
Thanks for any clarification. Without it, it quite hard to trust and use
this important tool.
Best regards
Samuel Gougeon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210128/5c89ed7a/attachment.htm>
More information about the users
mailing list