differential-datalog
differential-datalog copied to clipboard
How to use the self-profiler API?
I want to know that how to use the self-profiler API in the ddlog program.(And I don't know how to use the function introduced in profiler.md such as 'arrangement_size_profile'). Or is there any example file in the test directory?
The profiling API is not available from within a DDlog program. It can be invoked from a DDlog command file or from a C, Rust, or Java client. How are you using DDlog and in what context would you like to use profiling?
Also please note that this project is no longer being actively maintained.
The profiling API is not available from within a DDlog program. It can be invoked from a DDlog command file or from a C, Rust, or Java client. How are you using DDlog and in what context would you like to use profiling?
Can't I call the profiler API in the ddlog program? I am currently analyzing the resource consumption of the ddlog program, but I feel that the HTML file obtained by ‘profile’ from the ddlog command line does not meet my current expectations. I hope to be able to directly present the results of the profiler as strings by calling relevant APIs.
I hope to be able to directly present the results of the profiler as strings by calling relevant APIs.
Nope, there is no way to do this inside the program.
This is actually a much harder problem that you may expect. The way DDlog operates is that input is presented as a "transaction": a set of atomic changes made to a set of relations. Based on this, DDlog computes the output views and gives you their changes as an atomic "transaction". If we allowed DDlog to introspect the profile data as a set of tables we'd have a problem because (a) the data in these tables is not deterministic, like everything else in DDlog, and (b) the data in these tables changes continuously, as the program executes, and not just when a new input is presented. So if you write a DDlog relation that depends on the profile table, the profile table also depends on this ddlog relation indirectly, and you get thus an infinite loop in the evaluation which may never reach a fixed-point.