From ce19c949db9ab9d20c4b96833b6f2a8a99153ff1 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 8 Jun 2017 16:16:13 -0700 Subject: [PATCH] Enable breadth-first traversal. MozReview-Commit-ID: KJA2drcLTb5 --- components/style/gecko/global_style_data.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/style/gecko/global_style_data.rs b/components/style/gecko/global_style_data.rs index 2ba8749e24f..0f80a18816e 100644 --- a/components/style/gecko/global_style_data.rs +++ b/components/style/gecko/global_style_data.rs @@ -80,6 +80,12 @@ lazy_static! { } else { let configuration = rayon::Configuration::new() .num_threads(num_threads) + // Enable a breadth-first rayon traversal. This causes the work + // queue to be always FIFO, rather than FIFO for stealers and + // FILO for the owner (which is what rayon does by default). This + // ensures that we process all the elements at a given depth before + // proceeding to the next depth, which is important for style sharing. + .breadth_first() .thread_name(thread_name) .start_handler(thread_startup) .exit_handler(thread_shutdown);