mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
layout: Disable parallel display list building by default.
I've never see it result in a speedup. Actually, I don't think I've seen it result in anything better than a 50% slowdown. The arithmetic intensity is just too low, at least with the current algorithm. Parallel DL building can still be enabled with a debug flag if the algorithm is improved.
This commit is contained in:
parent
836ac8a0b6
commit
eef9c5d9bf
2 changed files with 12 additions and 6 deletions
|
@ -821,18 +821,18 @@ impl LayoutTask {
|
||||||
flow::mut_base(&mut **layout_root).clip =
|
flow::mut_base(&mut **layout_root).clip =
|
||||||
ClippingRegion::from_rect(&data.page_clip_rect);
|
ClippingRegion::from_rect(&data.page_clip_rect);
|
||||||
|
|
||||||
match rw_data.parallel_traversal {
|
match (&mut rw_data.parallel_traversal, opts::get().parallel_display_list_building) {
|
||||||
None => {
|
(&mut Some(ref mut traversal), true) => {
|
||||||
sequential::build_display_list_for_subtree(layout_root,
|
|
||||||
shared_layout_context);
|
|
||||||
}
|
|
||||||
Some(ref mut traversal) => {
|
|
||||||
parallel::build_display_list_for_subtree(layout_root,
|
parallel::build_display_list_for_subtree(layout_root,
|
||||||
self.profiler_metadata(),
|
self.profiler_metadata(),
|
||||||
self.time_profiler_chan.clone(),
|
self.time_profiler_chan.clone(),
|
||||||
shared_layout_context,
|
shared_layout_context,
|
||||||
traversal);
|
traversal);
|
||||||
}
|
}
|
||||||
|
_ => {
|
||||||
|
sequential::build_display_list_for_subtree(layout_root,
|
||||||
|
shared_layout_context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if data.goal == ReflowGoal::ForDisplay {
|
if data.goal == ReflowGoal::ForDisplay {
|
||||||
|
|
|
@ -152,6 +152,9 @@ 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,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_usage(app: &str, opts: &[getopts::OptGroup]) {
|
fn print_usage(app: &str, opts: &[getopts::OptGroup]) {
|
||||||
|
@ -183,6 +186,7 @@ pub fn print_debug_usage(app: &str) {
|
||||||
"Display an error when display list geometry escapes overflow region.");
|
"Display an error when display list geometry escapes overflow region.");
|
||||||
print_option("disable-share-style-cache",
|
print_option("disable-share-style-cache",
|
||||||
"Disable the style sharing cache.");
|
"Disable the style sharing cache.");
|
||||||
|
print_option("parallel-display-list-building", "Build display lists in parallel.");
|
||||||
|
|
||||||
println!("");
|
println!("");
|
||||||
}
|
}
|
||||||
|
@ -241,6 +245,7 @@ pub fn default_opts() -> Opts {
|
||||||
resources_path: None,
|
resources_path: None,
|
||||||
sniff_mime_types: false,
|
sniff_mime_types: false,
|
||||||
disable_share_style_cache: false,
|
disable_share_style_cache: false,
|
||||||
|
parallel_display_list_building: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,6 +425,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
|
||||||
resources_path: opt_match.opt_str("resources-path"),
|
resources_path: opt_match.opt_str("resources-path"),
|
||||||
sniff_mime_types: opt_match.opt_present("sniff-mime-types"),
|
sniff_mime_types: opt_match.opt_present("sniff-mime-types"),
|
||||||
disable_share_style_cache: debug_options.contains(&"disable-share-style-cache"),
|
disable_share_style_cache: debug_options.contains(&"disable-share-style-cache"),
|
||||||
|
parallel_display_list_building: debug_options.contains(&"parallel-display-list-building"),
|
||||||
};
|
};
|
||||||
|
|
||||||
set(opts);
|
set(opts);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue