6 ms·
Parallel processing demonstrates benefits only if you have physical cores to run code on them. If just one core is available for the app then parallel processin
by c-smile 9y ago
Parallel processing demonstrates benefits only if you have physical cores to run code on them. If just one core is available for the app then parallel processing is a loss due to thread preemption overload.
Is there any real life examples of achieved speedup?
- kzrdude 9y agoServo has their argument from power saving as well; do the work across many cores and go back to cpu power saving modes faster.
- taeric 9y agoI have similar concerns. I'm all for using my machine to its fullest, but in large, applications like web browsing should be an additional thing I am doing on my computer, not something that thinks it can take the full computer. Though, I have to admit I am also a little torn on this. Yes, browsing is typically done "during compile" or some other task. However, I have also begun doing most of that work remotely so that I can save battery on my laptop. To that end, it is now less of a concern on preserving cores for my tasks that actually need it.
- matthewmacleod 9y agoIf that’s what you want to do, the you should ‘nice’ your web browser (or use whatever priority mechanism your environment had available). Artificially limiting performance is absolutely the wrong approach!
- taeric 9y agoIt isn't artificially limiting. If my browser didn't need all of my cores to perform, we wouldn't be having this discussion. :) And I seriously question whether my browser needs this to perform well. I am not completely closed to the idea, but I am highly skeptical.
- matthewmacleod 9y agoThe fact that it's been done is some evidence that it's required. If it weren't, it's hard to imagine why limited resources would be wasted on it! Almost every modern device running a browser has multiple cores, and that trend is almost certainly going to increase – so it definitely feels like allowing a core part of the web platform to expand across cores will be beneficial.
- taeric 9y agoI challenge that. That it was done is as much evidence that it was doable as that it was required. It is also a bloat race. Web pages are getting increasingly complicated. With very little benefit to end users. I'd wager a growing number of the cycles and network requests are going to tracking, nowdays. Not to mention the ui language doing more and more contortions to give us a page that could be much more succinctly described. None of this is to say I want it stopped. I just have a feeling of concern that this is leading to an ever increasing march to faster and faster machines to do basic work.
- moosingin3space 9y agoDo you have a similar concern for all multithreaded programs?
- taeric 9y agoIn general, yes. That my computer can do many things is something I take advantage of as a user. The programs should use them to their advantage, but by and large, most programs do not need all of the processing capabilities of my computer, so I expect they should play well together. (Indeed, it takes effort to get the GPU of my computer to help out with anything.)
- rhencke 9y agoThis is the job of your operating system's scheduler - to divide the limited resource of your computer's CPU time among different competing tasks. In the modern era, a program cannot take more than its fair share of CPU time - otherwise, a runaway program could easily render your computer nearly unusable. (Linux, macOS and Windows all use preemptive multitasking.) The way to tell your operating system what you desire prioritized is, on *nix systems, 'nice'.
- taeric 9y agoI'm well aware of that. I also know that, in general, having to schedule things slows them down. If everything I'm running is trying to schedule something on my entire machine, it is giving my OS more work. Which will, by necessity, be harder to schedule and slow things down. I'm not necessarily against all of this, but I'm also not eagerly embracing more crap to slow down my machine for no apparent reason.
- demarq 9y agoYou are assuming that your OS scheduler is nearly at capacity, it isn't. And moreover your CPU is will spend most of it's life idle. I could almost guarantee you this is not the bottleneck of any modern setup.
- pcwalton 9y agoThis problem is the responsibility of the OS scheduler. One of the most important goals of any scheduler should be to give foreground UI processes that spend a lot of time sleeping in event loops priority. So if your OS scheduler is properly designed (as the ones in all major OS's are) a threaded browser shouldn't interfere with the system's responsiveness.
- sanxiyn 9y agoFirst, Stylo has sequential mode. Choice of sequential and parallel is entirely modular. It should be easy to use sequential when you are on single core. Stylo actually achieves nearly linear speedup if you just measure styling. It's really impressive.
- pcwalton 9y ago> Is there any real life examples of achieved speedup? Yes, most pages have significant speedups during the initial restyle especially. Wikipedia pages tend to get 3x or so improved style recalc time on typical systems with Intel quad core CPUs, for example. Of course, styling is only one part of the whole, so your overall speedups are limited by the rest of the rendering pipeline. That's Amdahl's Law for you. But that's no reason to not parallelize at all; it just means that we have lots more work to do once this is done :)
- majewsky 9y ago> Wikipedia pages tend to get 3x or so improved style recalc time on typical systems with Intel quad core CPUs, for example. Do you have absolute numbers? If it's 100 vs. 300 ms, that'd be huge. If it's 1 vs. 3 ms, I don't really care.
- pcwalton 9y agoOn my Haswell MBP, Stylo can take first pageload styles on Wikipedia pages from 150-200 ms down to 50 ms or so, last I checked.
- metajack 9y agoThe sequential traversal code is separate and does not have parallel overhead. On a single core machine you will get the sequential traversal. Note that Stylo is still faster than the old Gecko system even in sequential mode.