# HG changeset patch # User Valentin Gatien-Baron # Date 1590852990 14400 # Node ID 7ca1d635e4a6250122d245ed3d6a06c9b665e6df # Parent 69d3ce00df997c945a24d22d5df486a195472ca2 rust: add a pointer for profiling to the README As figuring out how to get useful profiles is not obvious. Differential Revision: https://phab.mercurial-scm.org/D8603 diff -r 69d3ce00df99 -r 7ca1d635e4a6 rust/README.rst --- a/rust/README.rst Sat May 30 10:28:46 2020 -0400 +++ b/rust/README.rst Sat May 30 11:36:30 2020 -0400 @@ -34,6 +34,21 @@ One day we may use this environment variable to switch to new experimental binding crates like a hypothetical ``HGWITHRUSTEXT=hpy``. +Profiling +========= + +Setting the environment variable ``RUST_LOG=trace`` will make hg print +a few high level rust-related performance numbers. It can also +indicate why the rust code cannot be used (say, using lookarounds in +hgignore). + +``py-spy`` (https://github.com/benfred/py-spy) can be used to +construct a single profile with rust functions and python functions +(as opposed to ``hg --profile``, which attributes time spent in rust +to some unlucky python code running shortly after the rust code, and +as opposed to tools for native code like ``perf``, which attribute +time to the python interpreter instead of python functions). + Developing Rust ===============