Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the self-profiler API? #1173

Open
bluegodg opened this issue Dec 9, 2023 · 5 comments
Open

How to use the self-profiler API? #1173

bluegodg opened this issue Dec 9, 2023 · 5 comments

Comments

@bluegodg
Copy link

bluegodg commented Dec 9, 2023

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?

@ryzhyk
Copy link
Contributor

ryzhyk commented Dec 11, 2023

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?

@ryzhyk
Copy link
Contributor

ryzhyk commented Dec 11, 2023

Also please note that this project is no longer being actively maintained.

@bluegodg
Copy link
Author

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.

@ryzhyk
Copy link
Contributor

ryzhyk commented Dec 11, 2023

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.

@mihaibudiu
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants