mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove parallel display list construction
Parallel display list construction hasn't been shown to give any performance gains. It is also incompatible with the current flat display list implementation. Once flat display lists have landed, we can explore possible benefits of parallel construction once again.
This commit is contained in:
parent
ff20a2d3dc
commit
630a9d4255
3 changed files with 3 additions and 80 deletions
|
@ -855,19 +855,7 @@ impl LayoutThread {
|
||||||
flow::mut_base(flow_ref::deref_mut(layout_root)).clip =
|
flow::mut_base(flow_ref::deref_mut(layout_root)).clip =
|
||||||
ClippingRegion::from_rect(&data.page_clip_rect);
|
ClippingRegion::from_rect(&data.page_clip_rect);
|
||||||
|
|
||||||
match (&mut self.parallel_traversal, opts::get().parallel_display_list_building) {
|
sequential::build_display_list_for_subtree(layout_root, shared_layout_context);
|
||||||
(&mut Some(ref mut traversal), true) => {
|
|
||||||
parallel::build_display_list_for_subtree(layout_root,
|
|
||||||
metadata,
|
|
||||||
sender,
|
|
||||||
shared_layout_context,
|
|
||||||
traversal);
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
sequential::build_display_list_for_subtree(layout_root,
|
|
||||||
shared_layout_context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if data.goal == ReflowGoal::ForDisplay {
|
if data.goal == ReflowGoal::ForDisplay {
|
||||||
debug!("Done building display list.");
|
debug!("Done building display list.");
|
||||||
|
|
|
@ -17,8 +17,8 @@ use std::sync::atomic::{AtomicIsize, Ordering};
|
||||||
use style::dom::{TNode, UnsafeNode};
|
use style::dom::{TNode, UnsafeNode};
|
||||||
use style::parallel::{CHUNK_SIZE, WorkQueueData};
|
use style::parallel::{CHUNK_SIZE, WorkQueueData};
|
||||||
use style::parallel::{run_queue_with_custom_work_data_type};
|
use style::parallel::{run_queue_with_custom_work_data_type};
|
||||||
use traversal::{AssignBSizesAndStoreOverflow, AssignISizes, BubbleISizes};
|
use traversal::AssignBSizesAndStoreOverflow;
|
||||||
use traversal::{BuildDisplayList, ComputeAbsolutePositions, PostorderNodeMutTraversal};
|
use traversal::{AssignISizes, BubbleISizes, PostorderNodeMutTraversal};
|
||||||
use util::opts;
|
use util::opts;
|
||||||
use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
|
use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
|
||||||
|
|
||||||
|
@ -200,23 +200,6 @@ impl<'a> ParallelPreorderFlowTraversal for AssignISizes<'a> {
|
||||||
|
|
||||||
impl<'a> ParallelPostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> {}
|
impl<'a> ParallelPostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> {}
|
||||||
|
|
||||||
impl<'a> ParallelPreorderFlowTraversal for ComputeAbsolutePositions<'a> {
|
|
||||||
fn run_parallel(&self,
|
|
||||||
unsafe_flows: UnsafeFlowList,
|
|
||||||
proxy: &mut WorkerProxy<SharedLayoutContext, UnsafeFlowList>) {
|
|
||||||
self.run_parallel_helper(unsafe_flows,
|
|
||||||
proxy,
|
|
||||||
compute_absolute_positions,
|
|
||||||
build_display_list)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn should_record_thread_ids(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> ParallelPostorderFlowTraversal for BuildDisplayList<'a> {}
|
|
||||||
|
|
||||||
fn assign_inline_sizes(unsafe_flows: UnsafeFlowList,
|
fn assign_inline_sizes(unsafe_flows: UnsafeFlowList,
|
||||||
proxy: &mut WorkerProxy<SharedLayoutContext, UnsafeFlowList>) {
|
proxy: &mut WorkerProxy<SharedLayoutContext, UnsafeFlowList>) {
|
||||||
let shared_layout_context = proxy.user_data();
|
let shared_layout_context = proxy.user_data();
|
||||||
|
@ -237,28 +220,6 @@ fn assign_block_sizes_and_store_overflow(
|
||||||
assign_block_sizes_traversal.run_parallel(unsafe_flow)
|
assign_block_sizes_traversal.run_parallel(unsafe_flow)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compute_absolute_positions(
|
|
||||||
unsafe_flows: UnsafeFlowList,
|
|
||||||
proxy: &mut WorkerProxy<SharedLayoutContext, UnsafeFlowList>) {
|
|
||||||
let shared_layout_context = proxy.user_data();
|
|
||||||
let layout_context = LayoutContext::new(shared_layout_context);
|
|
||||||
let compute_absolute_positions_traversal = ComputeAbsolutePositions {
|
|
||||||
layout_context: &layout_context,
|
|
||||||
};
|
|
||||||
compute_absolute_positions_traversal.run_parallel(unsafe_flows, proxy);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn build_display_list(unsafe_flow: UnsafeFlow,
|
|
||||||
shared_layout_context: &SharedLayoutContext) {
|
|
||||||
let layout_context = LayoutContext::new(shared_layout_context);
|
|
||||||
|
|
||||||
let build_display_list_traversal = BuildDisplayList {
|
|
||||||
layout_context: &layout_context,
|
|
||||||
};
|
|
||||||
|
|
||||||
build_display_list_traversal.run_parallel(unsafe_flow);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn traverse_flow_tree_preorder(
|
pub fn traverse_flow_tree_preorder(
|
||||||
root: &mut FlowRef,
|
root: &mut FlowRef,
|
||||||
profiler_metadata: Option<TimerMetadata>,
|
profiler_metadata: Option<TimerMetadata>,
|
||||||
|
@ -281,20 +242,3 @@ pub fn traverse_flow_tree_preorder(
|
||||||
});
|
});
|
||||||
}, shared_layout_context);
|
}, shared_layout_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_display_list_for_subtree(
|
|
||||||
root: &mut FlowRef,
|
|
||||||
profiler_metadata: Option<TimerMetadata>,
|
|
||||||
time_profiler_chan: time::ProfilerChan,
|
|
||||||
shared_layout_context: &SharedLayoutContext,
|
|
||||||
queue: &mut WorkQueue<SharedLayoutContext, WorkQueueData>) {
|
|
||||||
run_queue_with_custom_work_data_type(queue, |queue| {
|
|
||||||
profile(time::ProfilerCategory::LayoutParallelWarmup, profiler_metadata,
|
|
||||||
time_profiler_chan, || {
|
|
||||||
queue.push(WorkUnit {
|
|
||||||
fun: compute_absolute_positions,
|
|
||||||
data: (box vec![mut_owned_flow_to_unsafe_flow(root)], 0),
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}, shared_layout_context);
|
|
||||||
}
|
|
||||||
|
|
|
@ -169,9 +169,6 @@ pub struct Opts {
|
||||||
/// Whether Style Sharing Cache is used
|
/// Whether Style Sharing Cache is used
|
||||||
pub disable_share_style_cache: bool,
|
pub disable_share_style_cache: bool,
|
||||||
|
|
||||||
/// Whether to run absolute position calculation and display list construction in parallel.
|
|
||||||
pub parallel_display_list_building: bool,
|
|
||||||
|
|
||||||
/// Translate mouse input into touch events.
|
/// Translate mouse input into touch events.
|
||||||
pub convert_mouse_to_touch: bool,
|
pub convert_mouse_to_touch: bool,
|
||||||
|
|
||||||
|
@ -263,9 +260,6 @@ pub struct DebugOptions {
|
||||||
/// Disable the style sharing cache.
|
/// Disable the style sharing cache.
|
||||||
pub disable_share_style_cache: bool,
|
pub disable_share_style_cache: bool,
|
||||||
|
|
||||||
/// Build display lists in parallel.
|
|
||||||
pub parallel_display_list_building: bool,
|
|
||||||
|
|
||||||
/// Translate mouse input into touch events.
|
/// Translate mouse input into touch events.
|
||||||
pub convert_mouse_to_touch: bool,
|
pub convert_mouse_to_touch: bool,
|
||||||
|
|
||||||
|
@ -316,7 +310,6 @@ impl DebugOptions {
|
||||||
"trace-layout" => debug_options.trace_layout = true,
|
"trace-layout" => debug_options.trace_layout = true,
|
||||||
"validate-display-list-geometry" => debug_options.validate_display_list_geometry = true,
|
"validate-display-list-geometry" => debug_options.validate_display_list_geometry = true,
|
||||||
"disable-share-style-cache" => debug_options.disable_share_style_cache = true,
|
"disable-share-style-cache" => debug_options.disable_share_style_cache = true,
|
||||||
"parallel-display-list-building" => debug_options.parallel_display_list_building = true,
|
|
||||||
"convert-mouse-to-touch" => debug_options.convert_mouse_to_touch = true,
|
"convert-mouse-to-touch" => debug_options.convert_mouse_to_touch = true,
|
||||||
"replace-surrogates" => debug_options.replace_surrogates = true,
|
"replace-surrogates" => debug_options.replace_surrogates = true,
|
||||||
"gc-profile" => debug_options.gc_profile = true,
|
"gc-profile" => debug_options.gc_profile = true,
|
||||||
|
@ -497,7 +490,6 @@ pub fn default_opts() -> Opts {
|
||||||
profile_script_events: false,
|
profile_script_events: false,
|
||||||
profile_heartbeats: false,
|
profile_heartbeats: false,
|
||||||
disable_share_style_cache: false,
|
disable_share_style_cache: false,
|
||||||
parallel_display_list_building: false,
|
|
||||||
convert_mouse_to_touch: false,
|
convert_mouse_to_touch: false,
|
||||||
exit_after_load: false,
|
exit_after_load: false,
|
||||||
no_native_titlebar: false,
|
no_native_titlebar: false,
|
||||||
|
@ -737,7 +729,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
|
||||||
relayout_event: debug_options.relayout_event,
|
relayout_event: debug_options.relayout_event,
|
||||||
validate_display_list_geometry: debug_options.validate_display_list_geometry,
|
validate_display_list_geometry: debug_options.validate_display_list_geometry,
|
||||||
disable_share_style_cache: debug_options.disable_share_style_cache,
|
disable_share_style_cache: debug_options.disable_share_style_cache,
|
||||||
parallel_display_list_building: debug_options.parallel_display_list_building,
|
|
||||||
convert_mouse_to_touch: debug_options.convert_mouse_to_touch,
|
convert_mouse_to_touch: debug_options.convert_mouse_to_touch,
|
||||||
exit_after_load: opt_match.opt_present("x"),
|
exit_after_load: opt_match.opt_present("x"),
|
||||||
no_native_titlebar: opt_match.opt_present("b"),
|
no_native_titlebar: opt_match.opt_present("b"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue