Skip to content

Commit 105117e

Browse files
Kobzolnnethercote
authored andcommitted
Mention disabling debuginfo to reduce compilation times
1 parent e08e6d2 commit 105117e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/build-configuration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,22 @@ comprehensive documentation in the excellent [`min-sized-rust`] repository.
322322
The following build configuration options are designed primarily to minimize
323323
compile times.
324324

325+
### Disable debuginfo generation
326+
327+
If you want to improve the compile times of `dev` (unoptimized) builds and
328+
you're not using a debugger, consider disabling debuginfo. It can improve
329+
incremental rebuild times by 2-3x.
330+
331+
You can do that by putting this in your `Cargo.toml` file:
332+
```toml
333+
[profile.dev]
334+
debug = false
335+
```
336+
337+
Note that this means that stack traces will not contain line information.
338+
If you want to keep useful stack traces, but do not require full information
339+
for the debugger, you can use `debug = "line-tables-only"` instead.
340+
325341
### Linking
326342

327343
A big part of compile time is actually linking time, particularly when

0 commit comments

Comments
 (0)