docs/dev/src/build-and-run/profiles.md
RisingWave uses Cargo profiles to manage build settings. To briefly introduce Cargo profiles, here is a snippet from the Cargo References:
Profiles provide a way to alter the compiler settings, influencing things like optimizations and debugging symbols.
Cargo has 4 built-in profiles:
dev,release,test, andbench. The profile is automatically chosen based on which command is being run if a profile is not specified on the command-line. In addition to the built-in profiles, custom user-defined profiles can also be specified.
All profiles talked in this document are defined in the Cargo.toml file of the root directory of the project. Please always refer to it for the most up-to-date information.
RisingWave tweaks some settings of the built-in profiles to better fit its needs, in the sections of [profile.<built-in-profile>] in Cargo.toml. For example,
dev: for local development and testing
release: for local testing with near-production performance
RisingWave also defines some custom profiles that inherit from the built-in profiles, in the sections of [profile.<custom-profile>] in Cargo.toml. For example,
production: for distribution and production deployment
releaseci-dev: for pull-request pipelines in CI
devci-release: for main and main-cron pipelines in CI
releaseci-sim: for madsim simulation tests in CI
ci-devTo give a better idea of the differences between the profiles, here is a matrix comparing the profiles:
| Profile | Debug Info | cfg(debug_assertions) | Performance | Build Time |
|---|---|---|---|---|
dev | Full | true | Bad | Fastest |
release | Full | false | Good | Slow |
production | Full | false | Best | Slowest |
ci-dev | Backtrace only | true | Medium | Fast |
ci-release | Backtrace only | true | Good | Slow |
ci-sim | Backtrace only | true | Medium | Medium |
Some miscellaneous notes:
cfg(debug_assertions) can be roughly used to determine whether it's a production environment or not. Note that even though ci-release contains release in its name, the debug_assertions are still enabled.By default, RisingWave (and RiseDev) uses the dev profile for local development and testing. To use release profile instead, you can set the corresponding configuration entry by running risedev configure. Other profiles are for their specific use cases and are not meant to be used directly by developers, thus not available with RiseDev.