Skip to content

Commit 092cde5

Browse files
committed
Building Servo: update production; add -stripped and profiling
1 parent 3f006fb commit 092cde5

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

src/hacking/building-servo.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,58 @@ There are three main build profiles, which you can build and use independently o
5252
<th>mach option
5353
<td><code>-d</code>
5454
<td><code>-r</code>
55-
<td><code>--profile production</code>
55+
<td><code>--prod</code>
5656
<tr>
5757
<th>optimised?
58-
<td>no<td>yes<td>yes
58+
<td><a href="https://doc.rust-lang.org/cargo/reference/profiles.html#dev">no</a>
59+
<td><a href="https://github.com/servo/servo/blob/457d37d94ee6966cad377c373d333a00c637e1ae/Cargo.toml#L153">yes</a>
60+
<td>yes, <a href="https://github.com/servo/servo/blob/457d37d94ee6966cad377c373d333a00c637e1ae/Cargo.toml#L159-L160">more</a> <a href="https://github.com/servo/servo/blob/457d37d94ee6966cad377c373d333a00c637e1ae/Cargo.toml#L170-L171">than</a> in <strong>release</strong>
5961
<tr>
60-
<th>debug info?
61-
<td>yes<td>no<td>no
62+
<th>maximum RUST_LOG level
63+
<td><code>trace</code>
64+
<td><code>info</code>
65+
<td><code>info</code>
6266
<tr>
6367
<th>debug assertions?
6468
<td>yes<td>yes(!)<td>no
6569
<tr>
66-
<th>maximum RUST_LOG level
67-
<td><code>trace</code><td><code>info</code><td><code>info</code>
70+
<th>debug info?
71+
<td>yes<td>no<td>no
72+
<tr>
73+
<th>symbols?
74+
<td>yes<td>no<td>yes
75+
<tr>
76+
<th>finds resources in<br>current working dir?
77+
<td>yes<td>yes<td>no(!)
78+
</table>
79+
80+
There are also two special variants of production builds for performance-related use cases:
81+
82+
- `production-stripped` builds are ideal for benchmarking Servo over time, with debug symbols stripped for faster initial startup
83+
- `profiling` builds are ideal for [profiling](profiling.md) and troubleshooting performance issues; they behave like a debug or release build, but have the same performance as a production build
84+
85+
<table>
86+
<thead>
87+
<tr>
88+
<th>
89+
<th>production
90+
<th>production-stripped
91+
<th>profiling
92+
<tbody>
93+
<tr>
94+
<th>mach <code>--profile</code>
95+
<td><code>production</code>
96+
<td><code>production-stripped</code>
97+
<td><code>profiling</code>
98+
<tr>
99+
<th>debug info?
100+
<td>no<td>no<td>yes
101+
<tr>
102+
<th>symbols?
103+
<td>yes<td>no<td>yes
68104
<tr>
69105
<th>finds resources in<br>current working dir?
70-
<td>yes<td>yes<td>no
106+
<td>no<td>no<td>yes(!)
71107
</table>
72108

73109
You can change these settings in a servobuild file (see [servobuild.example](https://github.com/servo/servo/blob/b79e2a0b6575364de01b1f89021aba0ec3fcf399/servobuild.example)) or in the root [Cargo.toml](https://github.com/servo/servo/blob/b79e2a0b6575364de01b1f89021aba0ec3fcf399/Cargo.toml).

0 commit comments

Comments
 (0)