firefox-devtools / firefox-devtools/profiler
<DebugWarning> is incorrect because it doesn't differentiate between optimized builds with/without release optimizations
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
The warning that was implemented in #2966 (for #976) shows the following text for profiles obtained from Firefox debug builds:
> This profile was recorded in a build without release optimizations. Performance obervations might not apply to the release population.
Warning for debug builds is nice but it is not what we need. What we need is a warning that differentiates between non-debug builds of different rust optimization levels.
For context, the build settings have (at least) five independent levers that affect performance:
1. `--enable-debug`: off by default
1. `--enable-optimize`: on by default
1. C++ optimization level: not sure about the default value
1. `RUSTC_OPT_LEVEL`: 1 by default for local `--enable-optimize` builds, but can be set to 2
1. `--enable-release`: off by default for local builds, but on for official builds. Sets `RUSTC_OPT_LEVEL` to 2.
See https://groups.google.com/g/mozilla.dev.platform/c/pN9O5EB_1q4/m/tbbzmWztAQAJ for more context.
At the moment, the profile JSON only contains information about 1. (We tried to add information about 3 but [couldn't find an easy way to get the value](https://bugzilla.mozilla.org/show_bug.cgi?id=1326134#c15).) But this is not what #976 was originally filed about. #976 was originally filed about 4 and 5: the failure case we're trying to avoid is people profiling the default local build, which performs unexpectedly bad due to `RUSTC_OPT_LEVEL=1`. We want people to profile builds that have been compiled with `RUSTC_OPT_LEVEL=2`, or, alternatively, with `--enable-release` which also sets `RUSTC_OPT_LEVEL=2`.
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-339)
Contributor guide
Assessment
This issue has not been assessed yet.