On Tue, Jul 11, 2017 at 9:48 AM, Xidorn Quan <m...@upsuper.org> wrote:
> Tooling around debug info in Rust code still isn't great. > The good news is that tooling issues are generally among the easier ones to solve. Even the existing Rust code that is present in Firefox will require at least some of these things to be fixed. > The first thing comes to my mind is crash reports. It currently doesn't > always include useful panic message from Rust, see for example [1] and [2]. > I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1379857 for this. It's blocking https://bugzilla.mozilla.org/show_bug.cgi?id=1348896, which is the Rust crash tracking bug. For that, I just did an experiment. In my local repo, when I remove all > linking-related files from objdir/toolkit/library (to do a fresh linking), > it takes ~1.7min for linking. > > When I touch one cpp file (in my experiment, layout/style/nsCSSAnonBoxes.cpp > which is a reasonable small cpp file I happen to open), it takes 6s to > link, and size of xul.ilk (Incremental Linker File) increases by 856KB. > > When I touch one rs file (in my experiment, servo/components/gecko_binding > s/sugar/style_complex_color.rs which is a reasonable small rs file I > happen to be familiar with), it takes ~2min to link (even longer than the > fresh linking!) in addition to the compile time, and size of xul.ilk > increases by 27.44MB. And after that, when I touch that cpp file again, it > takes ~2.1min to link and size of xul.ilk increases by 54.64MB this time. > > I suspect the more times you touch rs files, the longer linking would > take, and I guess this is because we link all Rust code into a single > library, and then static link it into xul.dll, which makes the linker do > lots of wasteful work. There could also be some linker bug involves, though. > > To mitigate this, we can probably avoid incremental linking when Rust code > is touched. I also wonder if it is possible to avoid linking the whole > gkrust into xul.dll at all and see if that makes things better. It would > also be good to see if Rust developers have any advice for this situation. > Would you mind filing a bug report for this issue? I've posted a link to this thread on the Rust Internals board: https://internals.rust-lang.org/t/dev-platform-discussion- on-getting-more-rust-code-into-firefox/5523 Nick _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform