diff --git a/src/hacking/building-servo.md b/src/hacking/building-servo.md index 354a3b2..8c972c1 100644 --- a/src/hacking/building-servo.md +++ b/src/hacking/building-servo.md @@ -52,22 +52,58 @@ There are three main build profiles, which you can build and use independently o mach option -d -r - --profile production + --prod optimised? - noyesyes + no + yes + yes, more than in release - debug info? - yesnono + maximum RUST_LOG level + trace + info + info debug assertions? yesyes(!)no - maximum RUST_LOG level - traceinfoinfo + debug info? + yesnono + + symbols? + yesnoyes + + finds resources in
current working dir? + yesyesno(!) + + +There are also two special variants of production builds for performance-related use cases: + +- `production-stripped` builds are ideal for benchmarking Servo over time, with debug symbols stripped for faster initial startup +- `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 + + + + + + + + +
+ production + production-stripped + profiling +
mach --profile + production + production-stripped + profiling +
debug info? + nonoyes +
symbols? + yesnoyes
finds resources in
current working dir? -
yesyesno + nonoyes(!)
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). diff --git a/src/hacking/profiling.md b/src/hacking/profiling.md index 3824d3a..a2a077c 100644 --- a/src/hacking/profiling.md +++ b/src/hacking/profiling.md @@ -2,18 +2,14 @@ # Profiling -First, ensure that you are building Servo in release (optimized) mode with optimal debugging symbols: -In Cargo.toml: +When profiling Servo or troubleshooting performance issues, make sure your build is optimised while still allowing for accurate profiling data. -``` -[profile.release] -debug = true -lto = false +```sh +$ ./mach build --profile profiling --with-frame-pointer ``` -``` - ./mach build --release --with-frame-pointers -``` +- **--profile profiling** builds Servo with [our profiling configuration](building-servo.md#build-profiles) +- **--with-frame-pointer** builds Servo with stack frame pointers on all platforms Several ways to get profiling information about Servo's runs: * [Interval Profiling](#interval-profiling)