[ Development Environment and Global Settings | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

profile(+Goal)

Profile the goal and print the times spent in each predicate.
+Goal
Atom or a compound term.

Description

This predicate invokes the profiler. The profiler first executes Goal in profiling mode, which means that during its execution interrupts are generated at regular intervals and the profiler remembers the currently executing procedure. When the goal succeeds or fails, the profiler prints so and then it prints the statistics about the time spent in every encountered procedure. Goal can be any Prolog goal, it does not have to be compiled in a special profiling mode and no Prolog flags have to be set. The time spent in simple predicates (i.e. those with call_type prolog, written in C) is counted to their parent clause.

A temporary file /tmp/eclipse.prof.<pid> is used to store the profiling information and is removed upon exit.

Fail Conditions

None

Resatisfiable

No

Exceptions

(6) out of range
Flags contains an illegal flag.

Examples

[eclipse 6]: profile(boyer, [simple]).
rewriting...
proving...
goal succeeded

                PROFILING STATISTICS
                --------------------

Goal:             boyer
Total user time:  10.65s

Predicate             Module         %Time  Time
-------------------------------------------------
rewrite           /2  eclipse        52.3%  5.57s
garbage_collect   /0  sepia_kernel   23.1%  2.46s
rewrite_args      /2  eclipse        16.6%  1.77s
equal             /2  eclipse         4.7%  0.50s
...
plus              /3  eclipse         0.1%  0.01s



See Also

get_flag / 2, profile / 2