Commit b16b457
Use new
* Use new `hints.mostly-unused`
Most users of the `rustix` crate will use a fraction of its API surface
area.
Nightly rustc provides an option `-Zhint-mostly-unused` to tell it to
defer as much compilation as possible, which provides a substantial
performance improvement if most of that compilation doesn't end up
happening. Cargo plumbs this option through using the new `[hints]`
table. This will cause users of the `rustix` crate to default to setting
`hint-mostly-unused`. (Top-level crates can override this if they wish,
using a new profile option.)
Note that setting this hint does not increase the MSRV of the rustix
crate, as old versions of Cargo will ignore it. New versions of Cargo
will respect it automatically (and, until we stabilize it, Cargo will do
nothing unless you pass `-Zprofile-hint-mostly-unused` to cargo).
Some sample performance numbers: this takes `rustix` compilation time
with `all-apis` enabled from 5.9s to 4.3s (a 27% improvement).
* Add comment to the mostly-unused hinthints.mostly-unused (#1491)1 parent 12aa086 commit b16b457
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
0 commit comments