From 21921cfd73b7240c04a9319b4e059080c051a8f5 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 13 Sep 2023 22:16:20 -0700 Subject: [PATCH] docs: add a section about profiling --- docs/contributing.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/contributing.md b/docs/contributing.md index 239c06723..b3c8cd91d 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -320,3 +320,21 @@ you can submit a PR based on the `gh-pages` branch of The `.rs` files generated from `.proto` files are included in the repository, and there is a GitHub CI check that will complain if they do not match. + +## Profiling + +One easy-to-use sampling profiler +is [samply](https://github.com/mstange/samply). For example: +```shell +cargo install samply +samply record jj diff +``` +Then just open the link it prints. + +Another option is to use the instrumentation we've added manually (using +`tracing::instrument`) in various places. For example: +```shell +JJ_TRACE=/tmp/trace.json jj diff +``` +Then go to `https://ui.perfetto.dev/` in Chrome and load `/tmp/trace.json` from +there.