Hi all,

We now have link-time optimization (LTO) between Rust and C++ code
enabled on Nightly for all platforms (bug 1486042 [1]).  There have
been some concerns about potential slowdowns when crossing the C++ <=>
Rust boundary due to non-inlineable function calls, and Stylo needed
to implement some gnarly code copying between C++ and Rust to obtain
good performance.  With cross-language LTO enabled, such concerns and
hacks should become a thing of the past.

It is worth explicitly noting that enabling this feature does not seem
to have made much difference on our performance tests: if you are
doing performance work, you should *not* need to enable this feature.
(Which is a good thing, as it massively increases the amount of time
needed to link libxul...)  The primary benefit at the moment is not
having to implement code on both the C++ and Rust side as Stylo did
and to eliminate concerns that crossing the language boundary induces
a performance issue.

Please note that if you attempt to build your own cross-language
LTO-enabled binary on OS X, your binary will be broken in interesting
ways due to bugs in Xcode.  Work to error out much earlier in that
configuration is happening in bug 1563204 [2].

There were a number of people involved in this effort: Michael
Woerister did the Rust-side work [3].  David Major did the initial
landing for Win64 only [4].  Michael fixed some issues in bindgen that
prevented Win32 from working correctly [5].  And Mike Hommey tied up
loose ends and pushed things over the line while I was away for the
last two weeks.  Thanks to all involved!

-Nathan

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1486042
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1563204
[3] https://github.com/rust-lang/rust/issues/49879
[4] https://bugzilla.mozilla.org/show_bug.cgi?id=1512723
[5] https://github.com/rust-lang/rust-bindgen/pull/1558
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to