rust-lang / datafrog

A lightweight Datalog engine in Rust
Apache License 2.0
796 stars 43 forks source link

Add Variable statistics #21

Closed lqd closed 5 years ago

lqd commented 5 years ago

This adds simple profiling statistics in the spirit of #5, but inspired by Soufflé's profiler: adding the statistics per identifiable round.

For each round, there's the stable and recent tuple counts for each variable, as CSV, output to a io::Write of the user's choice.

We can talk about what precise data (or format) we'd like to see here. In the future, we can also add a self-profiling option to tally up the time each join operation took to create the tuples.

Here's how it looks right now ``` Variable,Round,Stable count,Recent count "subset",1,0,10 "requires",1,0,3 "potential_errors",1,0,0 "subset",2,10,0 "requires",2,3,3 "potential_errors",2,0,0 "subset",3,10,0 "requires",3,6,3 "potential_errors",3,0,0 ```
lqd commented 5 years ago

(IIRC the CI failure is due to current infra nightly build issues, or in general rustfmt not being available on the latest nightly or similar)

lqd commented 5 years ago

(The CI issue was indeed temporary)

nikomatsakis commented 5 years ago

r? @nikomatsakis

lqd commented 5 years ago

I'm working on dumping the stats to a file, so I'll close this PR until then.