show_profile_results/[0,1,2] development

Synopsis

show_profile_results

show_profile_results(+By)

show_profile_results(+By,+Num)

Displays the results of the last profiled execution.

Arguments


By one of [by_time,by_choice_points,by_calls,by_redos]

Num integer

Description

Displays profiling information accumulated from the last call to profile/1. The By argument specifies the display mode, which determines how the list is sorted and what the percentage figure included in the output refers to. The Num argument determines the maximum number of predicates displayed. This list is always sorted in descending order so that the top Num predicates are displayed for a give display mode.

The output lists the predicate name, number of calls, choice points and redos for the predicate, then the time in milliseconds and a percentage figure that depends on the display mode. For example, if the display mode is by_calls then this is the percentage of the total calls during profiling made to this predicate.

Then the callers are listed, showing for each caller the predicate name, clause number and call number within that clause of the call, followed by the number of calls made from here and the percentage of time spent in the predicate attributed to this caller.

show_profile_results/1 displays up to a maximum of 10 predicates.

show_profile_results/0 displays up to a maximum of 10 predicates using the by_time display mode.

This predicate is not supported in runtime systems.

Example

     | ?- show_profile_results(by_time, 3).
     Proc             Calls ChPts Redos Time  %
                                   Caller(proc,cl#,cll#,%)
     user:setof/3     227   0     0     2.04  34.0
                                   user:satisfy/1,6,1 152 61.0
                                   user:seto/3,1,1 48 20.0
                                   user:satisfy/1,7,1 27 17.0
     user:satisfy/1   35738 36782 14112 0.32  5.3
                                   user:satisfy/1,1,2 13857 43.0
                                   user:satisfy/1,2,1 12137 31.0
                                   user:satisfy/1,1,1 7315 18.0
                                   user:satisfy/1,3,1 1155 6.0
     user:inv_map_l/5 4732  4732  3115  0.20  3.3
                                   user:inv_map_l/5,2,1 3115 60.0
                                   user:inv_map/4,5,1 1617 40.0
     

See Also

profile/[0,1,2,3], get_profile_results/4, noprofile/0