Mercurial > hg
comparison rust/README.rst @ 44904:7ca1d635e4a6
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
author | Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> |
---|---|
date | Sat, 30 May 2020 11:36:30 -0400 |
parents | 69d3ce00df99 |
children | e604a3c03ab9 |
comparison
equal
deleted
inserted
replaced
44903:69d3ce00df99 | 44904:7ca1d635e4a6 |
---|---|
31 If the environment variable ``HGWITHRUSTEXT=cpython`` is set, the Rust | 31 If the environment variable ``HGWITHRUSTEXT=cpython`` is set, the Rust |
32 extension will be used by default unless ``--no-rust``. | 32 extension will be used by default unless ``--no-rust``. |
33 | 33 |
34 One day we may use this environment variable to switch to new experimental | 34 One day we may use this environment variable to switch to new experimental |
35 binding crates like a hypothetical ``HGWITHRUSTEXT=hpy``. | 35 binding crates like a hypothetical ``HGWITHRUSTEXT=hpy``. |
36 | |
37 Profiling | |
38 ========= | |
39 | |
40 Setting the environment variable ``RUST_LOG=trace`` will make hg print | |
41 a few high level rust-related performance numbers. It can also | |
42 indicate why the rust code cannot be used (say, using lookarounds in | |
43 hgignore). | |
44 | |
45 ``py-spy`` (https://github.com/benfred/py-spy) can be used to | |
46 construct a single profile with rust functions and python functions | |
47 (as opposed to ``hg --profile``, which attributes time spent in rust | |
48 to some unlucky python code running shortly after the rust code, and | |
49 as opposed to tools for native code like ``perf``, which attribute | |
50 time to the python interpreter instead of python functions). | |
36 | 51 |
37 Developing Rust | 52 Developing Rust |
38 =============== | 53 =============== |
39 | 54 |
40 The current version of Rust in use is ``1.34.2``, because it's what Debian | 55 The current version of Rust in use is ``1.34.2``, because it's what Debian |