Show More
@@ -64,6 +64,10 b' rust/*/target/' | |||||
64 | # Generated wheels |
|
64 | # Generated wheels | |
65 | wheelhouse/ |
|
65 | wheelhouse/ | |
66 |
|
66 | |||
|
67 | syntax: rootglob | |||
|
68 | # See Profiling in rust/README.rst | |||
|
69 | .cargo/config | |||
|
70 | ||||
67 | syntax: regexp |
|
71 | syntax: regexp | |
68 | ^\.pc/ |
|
72 | ^\.pc/ | |
69 | ^\.(pydev)?project |
|
73 | ^\.(pydev)?project |
@@ -40,7 +40,7 b' Special features' | |||||
40 | You might want to check the `features` section in ``hg-cpython/Cargo.toml``. |
|
40 | You might want to check the `features` section in ``hg-cpython/Cargo.toml``. | |
41 | It may contain features that might be interesting to try out. |
|
41 | It may contain features that might be interesting to try out. | |
42 |
|
42 | |||
43 |
To use features from the Makefile, use the `HG_RUST_FEATURES` environment |
|
43 | To use features from the Makefile, use the `HG_RUST_FEATURES` environment | |
44 | variable: for instance `HG_RUST_FEATURES="some-feature other-feature"` |
|
44 | variable: for instance `HG_RUST_FEATURES="some-feature other-feature"` | |
45 |
|
45 | |||
46 | Profiling |
|
46 | Profiling | |
@@ -51,6 +51,14 b' a few high level rust-related performanc' | |||||
51 | indicate why the rust code cannot be used (say, using lookarounds in |
|
51 | indicate why the rust code cannot be used (say, using lookarounds in | |
52 | hgignore). |
|
52 | hgignore). | |
53 |
|
53 | |||
|
54 | Creating a ``.cargo/config`` file with the following content enables | |||
|
55 | debug information in optimized builds. This make profiles more informative | |||
|
56 | with source file name and line number for Rust stack frames and | |||
|
57 | (in some cases) stack frames for Rust functions that have been inlined. | |||
|
58 | ||||
|
59 | [profile.release] | |||
|
60 | debug = true | |||
|
61 | ||||
54 | ``py-spy`` (https://github.com/benfred/py-spy) can be used to |
|
62 | ``py-spy`` (https://github.com/benfred/py-spy) can be used to | |
55 | construct a single profile with rust functions and python functions |
|
63 | construct a single profile with rust functions and python functions | |
56 | (as opposed to ``hg --profile``, which attributes time spent in rust |
|
64 | (as opposed to ``hg --profile``, which attributes time spent in rust | |
@@ -58,6 +66,11 b' to some unlucky python code running shor' | |||||
58 | as opposed to tools for native code like ``perf``, which attribute |
|
66 | as opposed to tools for native code like ``perf``, which attribute | |
59 | time to the python interpreter instead of python functions). |
|
67 | time to the python interpreter instead of python functions). | |
60 |
|
68 | |||
|
69 | Example usage: | |||
|
70 | ||||
|
71 | $ make PURE=--rust local # Don't forget to recompile after a code change | |||
|
72 | $ py-spy record --native --output /tmp/profile.svg -- ./hg ... | |||
|
73 | ||||
61 | Developing Rust |
|
74 | Developing Rust | |
62 | =============== |
|
75 | =============== | |
63 |
|
76 |
General Comments 0
You need to be logged in to leave comments.
Login now