Stream: t-compiler/rust-analyzer

Topic: find_path perf


matklad (Dec 17 2020 at 16:47, on Zulip):

@Jonas Schievink curious, have you looked at find_path (the entry point of auto-import) with perf / some other CPU profiler?

Jonas Schievink [he/him] (Dec 17 2020 at 16:48, on Zulip):

Nope, not yet

Jonas Schievink [he/him] (Dec 17 2020 at 16:48, on Zulip):

Haven't seen it cause perf issues since the ImportMap landed

matklad (Dec 17 2020 at 16:48, on Zulip):

I have a hunch that applying low-level optimizations there, like not allocating all over the place, might pay down the road

matklad (Dec 17 2020 at 16:48, on Zulip):

It's now a part of code completion

matklad (Dec 17 2020 at 16:49, on Zulip):

So it has battery/latency implications now

matklad (Dec 17 2020 at 16:49, on Zulip):

Context: https://github.com/rust-analyzer/rust-analyzer/pull/6918 and completion taking 100ms loaclly

matklad (Dec 17 2020 at 16:51, on Zulip):

There's a very noticiable completion threshold at about 100ms, when VS Code stops showing completion widget automatically

Jonas Schievink [he/him] (Dec 17 2020 at 16:51, on Zulip):

ooh, okay, I did notice that

matklad (Dec 17 2020 at 16:51, on Zulip):

Uhu

Jonas Schievink [he/him] (Dec 17 2020 at 16:51, on Zulip):

It's a bit hard to run perf on something like this

Jonas Schievink [he/him] (Dec 17 2020 at 16:52, on Zulip):

Ideally there'd be a rust-analyzer subcommand that computes completions in a loop or so

matklad (Dec 17 2020 at 16:52, on Zulip):

Hope one day we'll land if completion.elapsed() > 16ms { std::process::exit(666)} :D

matklad (Dec 17 2020 at 16:52, on Zulip):

@Jonas Schievink bench does something almost like that

matklad (Dec 17 2020 at 16:52, on Zulip):

it doesn't do a literal loop, because that shoudl be fast, as everything is cached

matklad (Dec 17 2020 at 16:52, on Zulip):

which is not really true since completions landed

matklad (Dec 17 2020 at 16:55, on Zulip):

Also, I still badly wish for

let _perf_guard = enable_perf_profiling();
matklad (Dec 17 2020 at 16:55, on Zulip):

Which would append over several runs

Joshua Nelson (Dec 17 2020 at 16:55, on Zulip):

matklad said:

Which would append over several runs

measureme is working on this

Joshua Nelson (Dec 17 2020 at 16:55, on Zulip):

or rustc-perf, sorry

matklad (Dec 17 2020 at 16:55, on Zulip):

Huh, I should really look into what's there in measureme

Joshua Nelson (Dec 17 2020 at 16:55, on Zulip):

https://github.com/rust-lang/rustc-perf/pull/752

matklad (Dec 17 2020 at 16:56, on Zulip):

haven't been able to follow the work

Joshua Nelson (Dec 17 2020 at 16:56, on Zulip):

yeah the hardware performance counters was a lot :sweat_smile: super impressive though

matklad (Dec 17 2020 at 16:57, on Zulip):

@Joshua Nelson as you did follow that discussion, quick question can I use hw counters without privilages on a VM?

Joshua Nelson (Dec 17 2020 at 16:57, on Zulip):

I never actually tried to use it, sorry

matklad (Dec 17 2020 at 16:57, on Zulip):

(X in XY: I want to get instruction counts on CI, but perf-stat doesn't work on actions)

Joshua Nelson (Dec 17 2020 at 16:58, on Zulip):

it might be in the writeup: https://hackmd.io/sH315lO2RuicY-SEt7ynGA?view

Last update: Jul 28 2021 at 03:15UTC