On Tue, Mar 13, 2018 at 3:35 PM, Nathan Froyd <nfr...@mozilla.com> wrote:
> On Tue, Mar 13, 2018 at 3:10 AM, Henri Sivonen <hsivo...@hsivonen.fi> wrote:
>> On Tue, Mar 13, 2018 at 2:56 AM, Nathan Froyd <nfr...@mozilla.com> wrote:
>>> (Our release builds use -O2 for Rust code.)
>>
>> What does cargo bench use by default?
>> (https://internals.rust-lang.org/t/default-opt-level-for-release-builds/4581
>> suggests -O3.)
>
> As mentioned by Alexis, -O3 is indeed what gets used by default.
>
>> That is, is cargo bench for a crate that's vendored into m-c
>> reflective of that crate's performance when included in a Firefox
>> release?
>
> I do not know.  I know that folks working on WebRender were finding
> that -O3 produces *much* better code for certain things; they filed
> bugs for rustc that I can't find right now.  I don't know if those
> bugs have been addressed.
>
> When Stylo was getting off the ground a year ago, mbrubeck did some
> -O2 vs. -O3 size analysis, which led to some -O2 vs. -O3 performance
> analysis in https://bugzilla.mozilla.org/show_bug.cgi?id=1328954.  The
> conclusion there is that -O3 wasn't worth it and came with a
> reasonably large codesize increase.
>
> I guess the answer is "probably, but you should measure to make sure"?

For encoding_rs, -O2 vs -O3 has pretty big performance effects in both
directions. (Didn't measure code size.) I think I'd rather have the
-O3 scenario than the -O2 scenario for encoding_rs.

Can we make a particular vendored crate (encoding_rs) use -O3 while
the default for Rust code remains at -O2?

-- 
Henri Sivonen
hsivo...@hsivonen.fi
https://hsivonen.fi/
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to