Commit afc1e77
committed
windows: Use new
Most users of the `windows` 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 `windows` 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 Windows
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 `windows` compilation time
with all Graphics and UI features enabled from 18.3s to 10.7s (a 42%
improvement), and takes compilation time with *all* features enabled
from 3m48s to 2m55s (a 23% improvement).hints.mostly-unused
1 parent 99208c8 commit afc1e77
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
0 commit comments