I think this would be valuable. The problem keeps coming up.
The extra instructions could automatically disappear the first time you use --release flag (i.e. cargo would write some hidden config "dont_show_optimization_hints = true").
Cargo already detects tty to decide whether to use color output. Maybe the hint flag could be updated only in tty.
On the other hand, people generally don't read the command output. (They should, but let's admit the reality.) I worry "show only first time" is basically equivalent to "show never", since people won't see the hint when it was printed first time.
If this is implemented, I think it should require manual action, like prompting the user to type cargo seen release-hint, and always print the hint until it is done. Note that Rust's own build system, rustbuild, uses the same strategy, see changelog-seen.
This is very true, but that's not an excuse not to provide better output. We'd be helping at least some people. It is also useful when people go to users., paste the output and are pointed out that the answer is right there: it tends to stick with people and read the output more carefully from then on
I'm skeptical that folks who miss the unoptimized word in the current output will magically start reading once we tack on an additional sentence. As a more experienced user, I'd rather not see two extra lines of output that are useless to me.
And a quick web search for "how optimize rust" also doesn't give an answer right away, even after you filter out the Rust (game) results.
I'm not 100% sure how I feel about this proposal. I like having an extra line to tell you what you need to do, but also, in most of my projects, I use [profile.dev] opt-level = 3 instead of --release, because I still want debugging symbols.