6 ms·
A third-option that I would like to see is extending the latter to an Electron alternative (aka using Servo as a cross-platform GUI). There's definitely positiv
by nvrspyx 6y ago
A third-option that I would like to see is extending the latter to an Electron alternative (aka using Servo as a cross-platform GUI). There's definitely positives to Electron, but it would be nice to see a more performant, less memory hungry, and more battery friendly alternative.
- devwastaken 6y agoServo last time I checked used the same if not more memory (100MB) for basic pages. There doesn't appear to be major differences for that application yet.
- jhoechtl 6y agoWhy should there be any great difference? Firefox is already written in a language where compilers have been optimized since decades. Rust will not bring that magic.
- alexusgracia 6y agoYap, it's magic
- ben-schaaf 6y agoRust isn't what can bring that "magic", but a rewrite sure can.
- nine_k 6y agoWhy, better lifetimes' control could reduce the RSS, and reduce the GC time / energy. (Provided that the C++ version is not strictly optimal WRT resource allocation; I think it's a rather safe bet.)
- asveikau 6y agoI'm not personally a rust zealot, but I know that rust builds on LLVM and therefore benefits from some of that very same engineering effort that was built to optimize C and C++.
- Subsentient 6y agoClang usually has worse performance than GCC.
- trevyn 6y agoIs there anything specific GCC does for performance that Clang/LLVM could adopt? How is this race expected to evolve over time?
- pmarin 6y agoNot answering your question but in my experience reading assembly output of the two compilers the unoptimized output of Clang is atrocious while GCC is closer of what a human could have wrote. Clang seems to have to do better in optimization passes to archive similar results. Usually Clang was a faster compiler in O1 but I don’t think it’s true anymore.
- PeCaN 6y agothat's just because gcc has certain optimization passes that can't be disabled (that said gcc -O0 is still absolutely nothing like what a human would write)
- PeCaN 6y agoit's not so much that gcc does anything specific so much as LLVM is just really really inefficient—they don't track compilation time at all so it's easy for releases to regress, half the stuff in there is academics implementing their PhD thesis aiming for algorithmic accuracy with little regard for efficiency, and LLVM's design itself is somewhat inefficient (multiple IRs, lots and lots of pointers in IR representation, etc) that said this makes it an excellent testbed but compilation time will keep getting slower every release until they start caring about it
- roblabla 6y agoThe rust compiler team now tracks LLVM performance, see [0]. They are able to spot regressions as soon as they get merged, and petition to get the change reverted or performance fixed when the impact is large. This has been fairly successful so far, but obviously needs sustained efforts if we are to ever dream of ever getting halfway decent compilation times. [0]: https://nikic.github.io/2020/05/10/Make-LLVM-fast-again.html https://nikic.github.io/2020/05/10/Make-LLVM-fast-again.html
- trevyn 6y agoRust makes it much easier to do complex performance optimizations safely, particularly those involving concurrency. The canonical example is the multi-threading of Servo’s CSS processor. It’s not an automatic magic bullet, but in a world where humans are still writing the code, Rust’s feature set makes many performance optimizations much more practical.
- jhoechtl 6y agoWhen did Firefox last crash on you? Aren't we optimzing on a problem which is practically non-existing?
- devwastaken 6y agoHypothetically there should be possibilities for significant memory reduction by being able to deploy only what you need from the runtime instead of having everything loaded at once. The memory usage part isn't really apart of rust or C, but rather that projects like chromium require significant hoops to jump through if you wanted to compile electron with only what you need. I expect that servo will be tackling this issue, the browser works standalone and that's a hefty achievement in itself.
- chubot 6y agoHas anyone tried Cobalt? It looks like something based on it could be an alternative to Electron. https://cobalt.foo/ https://cobalt.foo/ It's meant for embedded but that probably just means it's easy to build and uses low memory. A high-performance, small-footprint platform that implements a subset of HTML5/CSS/JS to run applications, including the YouTube TV app.
- spankalee 6y agoCobalt lags on modern web APIs pretty badly. I wouldn't recommend it.
- andrewmcwatters 6y agoCobalt is definitely not for someone like you.
- spankalee 6y agoI have to make code work in Cobalt as part of my job. You?
- kortilla 6y agoParent was tone deaf but the point is that if you want a bunch of cutting edge APIs then Cobalt isn’t really for you. It’s light weight.
- andrewmcwatters 6y agoI write compositors, like the one you work with. Wanna compare some more?
- dang 6y agoHey, please don't be a jerk in HN comments. If you know more than others, that's great, but the thing to do is to share some of what you know so the rest of us can learn something. If you don't want to do that, not posting anything is always an option. But please don't post unsubstantive comments and especially not nasty unsubstantive comments. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- Razengan 6y agoI wonder if they could also adapt into a game UI framework; design fast, cross platform, scalable game HUDs with HTML/JS.
- NetOpWibby 6y agoI’ve posed this question several times online and in the Servo repo and the response was always, “Umm, no, not interested.”
- pjmlp 6y agoThe alternative exists since 20 years now, run a background daemon with local browser, or ping back in the platform WebWidgets.