Show More
@@ -7,17 +7,19 Rust is not required to use (or build) M | |||||
7 | improves performance in some areas. |
|
7 | improves performance in some areas. | |
8 |
|
8 | |||
9 | There are currently four independent Rust projects: |
|
9 | There are currently four independent Rust projects: | |
|
10 | ||||
10 | - chg. An implementation of chg, in Rust instead of C. |
|
11 | - chg. An implementation of chg, in Rust instead of C. | |
11 | - hgcli. A project that provides a (mostly) self-contained "hg" binary, |
|
12 | - hgcli. A project that provides a (mostly) self-contained "hg" binary, | |
12 | for ease of deployment and a bit of speed, using PyOxidizer. See |
|
13 | for ease of deployment and a bit of speed, using PyOxidizer. See | |
13 | hgcli/README.md. |
|
14 | ``hgcli/README.md``. | |
14 | - hg-core (and hg-cpython): implementation of some |
|
15 | - hg-core (and hg-cpython): implementation of some | |
15 | functionality of mercurial in Rust, e.g. ancestry computations in |
|
16 | functionality of mercurial in Rust, e.g. ancestry computations in | |
16 | revision graphs, status or pull discovery. The top-level ``Cargo.toml`` file |
|
17 | revision graphs, status or pull discovery. The top-level ``Cargo.toml`` file | |
17 | defines a workspace containing these crates. |
|
18 | defines a workspace containing these crates. | |
18 | - rhg: a pure Rust implementation of Mercurial, with a fallback mechanism for |
|
19 | - rhg: a pure Rust implementation of Mercurial, with a fallback mechanism for | |
19 |
unsupported invocations. It reuses the logic `hg-core` but |
|
20 | unsupported invocations. It reuses the logic ``hg-core`` but | |
20 | interaction with Python. See `rust/rhg/README.md` for more details. |
|
21 | completely forgoes interaction with Python. See | |
|
22 | ``rust/rhg/README.md`` for more details. | |||
21 |
|
23 | |||
22 | Using Rust code |
|
24 | Using Rust code | |
23 | =============== |
|
25 | =============== | |
@@ -41,10 +43,10 Special features | |||||
41 | ================ |
|
43 | ================ | |
42 |
|
44 | |||
43 | In the future, compile-time opt-ins may be added |
|
45 | In the future, compile-time opt-ins may be added | |
44 | to the `features` section in ``hg-cpython/Cargo.toml``. |
|
46 | to the ``features`` section in ``hg-cpython/Cargo.toml``. | |
45 |
|
47 | |||
46 | To use features from the Makefile, use the `HG_RUST_FEATURES` environment |
|
48 | To use features from the Makefile, use the ``HG_RUST_FEATURES`` environment | |
47 | variable: for instance `HG_RUST_FEATURES="some-feature other-feature"` |
|
49 | variable: for instance ``HG_RUST_FEATURES="some-feature other-feature"``. | |
48 |
|
50 | |||
49 | Profiling |
|
51 | Profiling | |
50 | ========= |
|
52 | ========= | |
@@ -57,7 +59,7 hgignore). | |||||
57 | Creating a ``.cargo/config`` file with the following content enables |
|
59 | Creating a ``.cargo/config`` file with the following content enables | |
58 | debug information in optimized builds. This make profiles more informative |
|
60 | debug information in optimized builds. This make profiles more informative | |
59 | with source file name and line number for Rust stack frames and |
|
61 | with source file name and line number for Rust stack frames and | |
60 |
(in some cases) stack frames for Rust functions that have been inlined |
|
62 | (in some cases) stack frames for Rust functions that have been inlined:: | |
61 |
|
|
63 | ||
62 | [profile.release] |
|
64 | [profile.release] | |
63 |
debug = true |
|
65 | debug = true | |
@@ -69,7 +71,7 to some unlucky python code running shor | |||||
69 | as opposed to tools for native code like ``perf``, which attribute |
|
71 | as opposed to tools for native code like ``perf``, which attribute | |
70 | time to the python interpreter instead of python functions). |
|
72 | time to the python interpreter instead of python functions). | |
71 |
|
73 | |||
72 | Example usage: |
|
74 | Example usage:: | |
73 |
|
|
75 | ||
74 | $ make PURE=--rust local # Don't forget to recompile after a code change |
|
76 | $ make PURE=--rust local # Don't forget to recompile after a code change | |
75 |
$ py-spy record --native --output /tmp/profile.svg -- ./hg ... |
|
77 | $ py-spy record --native --output /tmp/profile.svg -- ./hg ... |
General Comments 0
You need to be logged in to leave comments.
Login now