Closed amato-gianluca closed 1 month ago
Hi Gianluca! Thank you for the report. The profilercc package is very sophisticated but hard to use and enable for large programs (like CiaoPP). Moreover, we found a couple of bugs that are producing the segmentation faults. We are working right now on simpler profiler alternatives (we'll try to commit something usable hopefully today).
Hi Jose, thanks for your reply.
I am able to use the profilercc package without compiling the Ciao Engine with the profiler support. I only get the number of calls for predicates and the number of ticks, but I think these information may be enough for what I am trying to do. Is the "number of ticks" reliable as an approximation of the total execution time of a predicate ?
Hi Gianluca,
Yes, number of ticks should be reliable approximation. Profilecc requires instrumentation at the Prolog-level and that may introduce too much noise. Another thing to consider is that currently CiaoPP domains can be much slower when loaded from a toplevel than then compiled statically (due to an issue with indexing in multifile predicates). We plan to solve this issue soon.
As promised we have recovered the naive profiler too. We are testing it locally before pushing to github (in a few minutes!).
Hi again,
Following up on my last message, we have just pushed a new Ciao version to GitHub which, apart from other changes, recovers (and improves a bit) the built-in profiler. This is a basic, relatively low overhead profiler, which can be used to determine call counts, times, etc. per predicate when executing a goal or an executable.
The changes are still in the master
branch (no new release yet). The manual (you need to generate it locally and see the "Profiling" chapter in Part I, or on the source of https://github.com/ciao-lang/ciao/blob/master/core/library/profile.pl) gives detailed instructions about how to use it with examples.
Time measuring in this profiler is a rough estimate (it just measures the time in a predicate until we call another one), but the overhead is smaller and do not require any source code changes (nor selecting cost centers, etc.). For large programs like CiaoPP, the profiling overhead for counting number of calls is normally quite low (negligible in some examples that I tried).
Please let us know if you find any problems!
P.D. We have also moved the cost center-based one (more powerful but more complex, with more overhead, and which currently needs some work) to its own bundle https://github.com/ciao-lang/profilercc.
(Marked as fixed, please feel free to reopen)
Hello, I am trying to use the
profilercc
package. If I understand correctly, in order to have access to all the features of the package, I need to recompile the Ciao engine withdebug-level=profile
. Therefore, I proceeded to recompile the code withUnfortunately, compilation of the
ciaodbg
bundle gives these errors:I tried to apply all the changes suggested by the compiler, and with further minor changes I was able to compile
ciaodbg
without errors. However, enabling profiling at that point was causing a lot of Segmentation Fault errors.