12 ms·
Graphics Team ships WebRender MVP
- jerheinze 7y agoThe article forgot to mention the important fact that it's written in Rust!
- Cynddl 7y agoNaive question: why is it important, compared to the developed features and new architecture?
- oregontechninja 7y agoBecause development of this particular project has been a large driving force of Mozilla's interaction with Rust.
- jerheinze 7y agoSince Rust is a memory safe language with nearly the same performance as C
- frutiger 7y agoEDIT: Parent commenter edited the comment to append "with the same performance as C", so you can ignore my reply. So is Python, JavaScript, Java, OCaml, Haskell... A more distinguishing feature of Rust is not only that it is memory safe but also that it doesn’t have a GC. In any case the presence of a single unsafe block can make the program no longer memory safe. Of course, if used appropriately, it vastly reduces the audit surface compared to something like C++.
- Someone1234 7y agoNone of those have nearly the same performance as C.
- chronogram 7y agoIs GC a negative? I’ve yet to see anyone go “well I would’ve written this in Golang but it’s got GC”. Even that new Windows driver style, where it’s split in two, can have half of it being GC’d, right? Looking at https://en.wikipedia.org/wiki/Windows_Driver_Frameworks https://en.wikipedia.org/wiki/Windows_Driver_Frameworks at least.
- saagarjha 7y ago> I’ve yet to see anyone go “well I would’ve written this in Golang but it’s got GC”. This is a dealbreaker in a lot of contexts where garbage collection pauses would be unacceptable.
- ncmncm 7y agoYes, GC is a negative. There is a huge literature in measures to mitigate its negatives. These always involve trading off one against another, and libraries are frequently incompatible with any particular mix of them.
- BubRoss 7y agoA GC is literally the only reason I haven't tried go.
- pygy_ 7y ago<rust-evangelism-strike-force> FEARLESS CONCURRENCY </rust-evangelism-strike-force> Rust makes it easier to write bug-free concurrent code. Webrender relies on this and I'm not sure Mozilla could have pulled it out in C++ in the same time frame, if at all.
- BubRoss 7y agoI think that's pretty presumptuous. My experience is that rust's checking is great, but much easier and safer concurrency can still be enabled by some work with data structures and program architecture.
- throwupaway123 7y agoIMozilla engineers have specifically said Stylo (Quantum Style whatever) would be impossible in C++, because they actually tried it in C++. Presumably it'd be the same with WebRender.
- BubRoss 7y agoImpossible is a strong word. Architecture makes a very big difference. They can claim it is impossible, but it really doesn't make sense. I'm surprised anyone would just take their word for it. Trying to use raw threads and ad-hoc futures is going to be difficult, but fundamentally concurrency is about separating data by dependencies. Dependency graphs that pass data around combined with lock free data structures can be used to isolate parts of the program so that dealing with concurrency is one generic part of the program.
- mkl 7y agoWebRender has come out of Mozilla's Servo browser engine project, which has had influence on the development of Rust itself. The language and the browser engine have been developed together, so this and other parts of the Quantum project [1] (mostly bringing parts of Servo into Firefox) are like the culmination of all this work, and a validation of the language. [1] https://wiki.mozilla.org/Quantum https://wiki.mozilla.org/Quantum
- amelius 7y agoCan Rust target the GPU?
- steveklabnik 7y agoSort of; it's not trivial, but some people have done it. See https://bheisler.github.io/post/rust-on-the-gpu-with-accel/ https://bheisler.github.io/post/rust-on-the-gpu-with-accel/ for example. I think https://blog.theincredibleholk.org/blog/2012/12/05/compiling-rust-for-gpus/ https://blog.theincredibleholk.org/blog/2012/12/05/compiling... is the earliest one I know of; two and a half years before Rust 1.0!
- k_bx 7y agoTremendous effort on a very complicated piece of software. I wish Firefox would also catch up on less complicated but needed so greatly features which are present in other browsers, like filling out credit card info and autocomplete=email input fields autocompletion.
- sambe 7y agoIt's being rolled out: https://wiki.mozilla.org/Firefox/Features/Form_Autofill#Child_Pages https://wiki.mozilla.org/Firefox/Features/Form_Autofill#Chil...
- sambe 7y agoShipping for Linux is waaay down the list: https://github.com/orgs/FirefoxGraphics/projects/1 https://github.com/orgs/FirefoxGraphics/projects/1 I assume due to driver issues?
- deleted 7y ago[deleted]
- chronogram 7y agoSeeing as Linux Firefox still doesn’t use any hardware acceleration, it’s probably because there’s no developer room for it.
- 781 7y agoNot only. There's Ubuntu Linux/Fedora Linux/Arch Linux, there's Wayland and a whole slew of compositors...
- Lorkki 7y agoAs always, the solution would be to not attempt to support "Linux", but to pick one distribution (or a manageable set) to support officially.
- eikenberry 7y agoDistro shouldn't matter one bit. Just scan for hardware acceleration support and enable it if found. Plenty of other applications do this without any per-distro changes.
- gregwtmtno 7y agoThis is an amazing achievement for the WebRender team, but users should manage their expectations with regard to performance improvements. The reality is that Firefox's current rendering engine is highly tuned, and switching to a new engine without major performance regressions is impressive. Keep in mind, there may be performance improvements coming down the line.
- xvilka 7y agoHopefully they will rewrite the rest of Firefox in Rust as soon as possible.
- inDigiNeous 7y ago... That is an gargantuan task. According to https://www.openhub.net/p/firefox/analyses/latest/languages_summary https://www.openhub.net/p/firefox/analyses/latest/languages_... they have over 5.5 million lines of code written in C++. That is an insane amount of code that would need to be rewritten, rechecked, retested and so on. Not going to happen anytime soon, if ever.
- SketchySeaBeast 7y agoI'm confused as to why someone would even want them to change the codebase - is this just an example of the "newer is better" problem we have here in tech? Is there something glaringly obvious about Rust that would make the effort worthwhile?
- gridlockd 7y agoBecause within that codebase there's an untold number of exploitable memory errors which put users at risk. Browsers have critical security issues all the time.
- SketchySeaBeast 7y agoSo would Rust remove all the potential exploits?
- viraptor 7y agoA few of them. It won't stop logic errors (although enums help here) but it will prevent buffer overflows, use-after-free, some cases of type confusion, uninitialised reads, and a few other problems.
- 7y ago
- deleted 7y ago[deleted]
- ncmncm 7y agoHere's hoping it is easy to switch off. Firefox has become extremely crashy, running under Qubes, where the GPU is forbidden, despite my turning off attempts at shader use everywhere I can find. E.g., even turning off "smooth scrolling" made a substantial difference. But it still crashes, even just loading a DDG search results page. Advice welcome. (No, abandoning Qubes is not an option.)
- yoasif_ 7y agoMozregression - https://mozilla.github.io/mozregression/ https://mozilla.github.io/mozregression/ should help you figure out where it broke. You can open a bug with the commit you found as "regressed by" - https://wiki.mozilla.org/BMO/UserGuide/BugFields#regressed_by https://wiki.mozilla.org/BMO/UserGuide/BugFields#regressed_b... to help developers track down how what they need to change to resolve the issue.
- pier25 7y agoSo Windows 10 + Nvidia GPU is only 4%? Huh. I would have thought this demographic would be larger. I guess most users are on laptops where integrated Intel GPUs are more common.
- noir_lord 7y agoI'm sorta in that 4%, I have an RTX2080 I use for gaming on my home desktop but I'm only in Win10 for gaming. Hopefully I'll be able to use the RTX with Firefox and Fedora down the line though (stably).