CodeTools[Profiling][Remove] - remove procedures from a table of profiling data
|
Calling Sequence
|
|
Remove(selector, tab)
|
|
Parameters
|
|
selector
|
-
|
boolean valued procedure
|
tab
|
-
|
table of profiling data
|
|
|
|
|
Description
|
|
•
|
The Remove(selector, tab) command is similar to the remove function. The boolean valued function selector is called on each element in tab. A copy of tab is returned with the elements for which selector returns true removed.
|
•
|
The selector parameter is a procedure that accepts two arguments. The first argument is the encoded name (see EncodeName) of the procedure and the second argument is the rtable containing the profiling data.
|
|
|
Examples
|
|
>
|
|
>
|
selector := proc(n,t)
# check the total number of function calls
if (t[1][1] > 5) then
return true;
else
return false;
end if;
end proc;
|
| (1) |
>
|
a := proc( )
return 1;
end proc;
|
| (2) |
>
|
b := proc( )
local i;
for i from 1 to 10 do
a();
end do;
end proc;
|
| (3) |
>
|
|
![t := TABLE([_Inert_ASSIGNEDNAME("a", "PROC") = Array([[10, 0, 0], [10, 0, 0]]), _Inert_ASSIGNEDNAME("b", "PROC") = Array([[1, 0, 0], [1, 0, 0], [10, 0, 0]])])](/support/helpjp/helpview.aspx?si=6144/file05649/math122.png)
| (4) |
>
|
|
a
a := proc()
|Calls Seconds Words|
PROC | 10 0.000 0|
1 | 10 0.000 0| return 1
end proc
b
b := proc()
local i;
|Calls Seconds Words|
PROC | 1 0.000 0|
1 | 1 0.000 0| for i to 10 do
2 | 10 0.000 0| a()
end do
end proc
| |
>
|
|
| (5) |
>
|
|
b
b := proc()
local i;
|Calls Seconds Words|
PROC | 1 0.000 0|
1 | 1 0.000 0| for i to 10 do
2 | 10 0.000 0| a()
end do
end proc
| |
|
|