5 ms·
Does the lack of a multi-threaded layout engine really matter? Don't pages load fast enough already? And if layout performance really is becoming a problem, par
by nly 13y ago
Does the lack of a multi-threaded layout engine really matter? Don't pages load fast enough already? And if layout performance really is becoming a problem, particularly in cases of dynamic DOM manipulation etc, isn't that largely the fault of the spec? Even shiny HTML5 is hardly designed for fiendishly complex UI layouts... it's an abomination for programmers and designers alike, and always has been. To this day it still requires herculean effort to achieve things that are trivial with real UI toolkits or publishing tools.
I guess now we're in this hole we best keep digging
- wmf 13y agoHTML layout is not super-fast on low-end phones, and due to marketing stupidity those phones have 4-8 slow cores instead of 1-2 fast cores. I imagine Servo could do well there. Drastically changing the HTML standard would take even longer than developing Servo.
- cpeterso 13y ago> due to marketing stupidity those phones have 4-8 slow cores instead of 1-2 fast cores. Beyond marketing, wouldn't more slow cores consume less battery power than fewer fast cores?
- ehsanu1 13y agoYes, this is also part of Servo's strategy apparently: spread work across multiple cores, but each core does less and can be more efficient in terms of power draw. Faster + less battery use in one fell swoop. Though it's not really clear to me why this actually results in an efficiency win over maxing out a single core.
- pcwalton 13y agoThe way I've heard it, as a very imprecise rule of thumb, increasing clock speed scales power consumption quadratically, while adding CPUs increases power consumption linearly. So, very roughly speaking, one 1.6 GHz CPU uses twice as much power as two 800 MHz CPUs.
- cwzwarich 13y agoThe equation for CMOS switching power (as opposed to leakage power) is capacitance * voltage^2 * frequency but the voltage limits the clock frequency. The exact scaling of maximum clock frequency with voltage depends on the circuit and the process, but from taking a glance at the voltage tables it looks like the main cores in current Snapdragons are generally running in the 0.8-1.2v range across their entire frequency range.
- Symmetry 13y agoMost of the power differences between cores these days isn't in terms of clock speeds but in terms of extra structures that cause more instruction to be executed each cycle. The rule of thumb involving voltage/speed scaling is that your power use is indeed the square of your performance more or less when you're in a reasonable region. However, a relatively simple in-order core like an ARM A7 might also only take 1/4 the energy to execute a given instruction of a complex out-or-order core like an ARM A15 even when both are clocked at 1 GHz on the same process.
- auvrw 13y ago> Though it's not really clear to me why this actually results in an efficiency win over maxing out a single core. i heard the whole multiple core thing is spurred in part by manufacturers trying to increase fab yield: if one of the cores on a multi-core chip is bad, it can still be sold, albeit at a lower price, rather than thrown out.
- wmf 13y agoIf apps were parallel, yes. But most of them aren't.
- reubenmorais 13y agoIf Servo works, most* of the Web will be parallel. * This is probably too optimistic.
- userbinator 13y agoI'd like to see a memory usage comparison with Servo, since mobile devices have far less memory than desktops. On the other hand, I believe that HTML layout can be done, using only a single thread, much faster and with far less memory than current mainstream browsers do, by greatly simplifying the code (i.e. remove excessive use of abstraction, using different data structures, etc.) Not exactly the same, but along the same lines as, this related item that appeared here a few days ago: https://news.ycombinator.com/item?id=7457674 https://news.ycombinator.com/item?id=7457674
- pcwalton 13y agoYou'd be surprised: it's not that easy to beat existing browser engines. The IE trick you mention is pretty trivial. That said, it is possible to win, and one of the great benefits of Servo is that its data structures are simpler than other browser engines' in many ways. But it's not as easy as you think.
- pcwalton 13y agoI think that it's clear that any technology that helps the browser better compete with native applications in terms of performance is worthwhile. Regarding new specs, we're of course working on that too, with specifications like flex box and grid layout. Part of Servo's goal is to steer the conversation toward what can be done to make future CSS specs parallelizable on CPUs and GPUs. But of course we want to be fast on existing Web content as well.
- frozenport 13y agoNative applications do layout and engines such as Qt are single threaded.
- vidarh 13y agoWhy is that a reason to remain single-threaded? Especially when most new hardware is multi-core.
- frozenport 13y agoConsider the parallel addition task, it takes N*log(N) instead of single threaded addition which takes N. Which is more energy efficient? If takes 10x the power to do layout in 20ms vs 30ms is it still a good deal?
- pcwalton 13y ago10x is a silly exaggeration. As for your general point, you'd be surprised: often consuming more power per second is much better for power efficiency than consuming less power if that power consumption lets you complete the task faster. That is because the wins of getting back to the CPU's low-power idle state quicker dominate everything else. It is almost always better to use the power available to you.
- callesgg 13y agoTry drawing lager pages. That is the bottleneck in one of my applications.
- nnethercote 13y ago> Don't pages load fast enough already? Ho ho ho... good one.