Stream: t-compiler/wg-polonius

Topic: Starting with Polonius


Eric Zhang (Sep 20 2020 at 20:08, on Zulip):

Hi, I read the blog posts linked here (https://rust-lang.github.io/compiler-team/working-groups/polonius/) and am interested in learning more about Polonius or hacking on it. What is the current status of the project?

I also noticed that the example in the README (inputs/clap-rs/app-parser-\{\{impl\}\}-add_defaults) takes around 2 minutes to run for me, rather than 4 seconds - just wondered if I'm doing something wrong. Thanks!

Jake Goulding (Sep 20 2020 at 20:33, on Zulip):

The latter might be debug vs release mode; which did you use?

Eric Zhang (Sep 20 2020 at 22:06, on Zulip):

I ran it with release mode using the same command from the README:

➜  polonius git:(master) cargo +nightly run --release -- -a DatafrogOpt inputs/clap-rs/app-parser-\{\{impl\}\}-add_defaults/
    Finished release [optimized] target(s) in 0.03s
     Running `target/release/polonius -a DatafrogOpt 'inputs/clap-rs/app-parser-{{impl}}-add_defaults/'`
--------------------------------------------------
Directory: inputs/clap-rs/app-parser-{{impl}}-add_defaults/
Time: 150.710s
Eric Zhang (Sep 20 2020 at 22:37, on Zulip):

Actually, I just replaced datafrog_opt::compute() with a function that does nothing, and it still takes >2 minutes to run. Is it just that reading the input facts takes a long time?

Vytautas Astrauskas (Sep 21 2020 at 06:08, on Zulip):

Is it just that reading the input facts takes a long time?

Are you using a shared drive? I know that using a local copy of a Windows share can cause serious performance problems.

lqd (Sep 21 2020 at 11:35, on Zulip):

Hi :) (I believe you're the author of crepe :wave:)

lqd (Sep 21 2020 at 11:36, on Zulip):

clap, which is the biggest function benchmarked in-tree, does indeed take 2 minutes nowadays instead of 4 seconds

lqd (Sep 21 2020 at 11:37, on Zulip):

the part taking a long time now is the move/init analysis

lqd (Sep 21 2020 at 11:41, on Zulip):

it's the first part of the computation: computing both move errors and init/uninit data used by the next part of the computation (liveness, which precedes the "borrowck"ing parts you've commented datafrog_opt::compute) -- specifically it's the move errors rules which are taking the longest time IIRC (one could comment the 2-3 related to those in this function and have clap go faster)

lqd (Sep 21 2020 at 11:43, on Zulip):

the move errors are in flux at the moment, in the recent spring Niko and Albin have devised a set of different rules to help with this efficiency problem, and other questions of preciseness (and avoiding false positives), and have started looking at actually emitting these move errors in rustc (right now polonius will compute them, slowly as you've seen, but rustc doesn't emit them yet)

lqd (Sep 21 2020 at 11:45, on Zulip):

however I don't know from the top of my head the exact status of both strands of work besides that there's in-progress work, maybe @Albin Stjerna could comment here :)

Last update: Jun 20 2021 at 00:30UTC