diff --git a/components/style/driver.rs b/components/style/driver.rs index cf48d831fdd..3b9534f7790 100644 --- a/components/style/driver.rs +++ b/components/style/driver.rs @@ -63,7 +63,10 @@ fn with_pool_in_place_scope<'scope, R>( /// See documentation of the pref for performance characteristics. fn work_unit_max() -> usize { - static_prefs::pref!("layout.css.stylo-work-unit-size") as usize + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.stylo-work-unit-size") as usize; + #[cfg(feature = "servo")] + return 16; } /// Do a DOM traversal for top-down and (optionally) bottom-up processing, generic over `D`. @@ -124,7 +127,12 @@ where discovered, root.as_node().opaque(), work_unit_max, - static_prefs::pref!("layout.css.stylo-local-work-queue.in-main-thread") as usize, + (|| { + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.stylo-local-work-queue.in-main-thread") as usize; + #[cfg(feature = "servo")] + return 32; + })(), PerLevelTraversalData { current_dom_depth: root.depth() }, maybe_scope, traversal, diff --git a/components/style/parallel.rs b/components/style/parallel.rs index 08f081b30e1..bb352c95101 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -81,6 +81,7 @@ fn distribute_one_chunk<'a, 'scope, E, D>( D: DomTraversal, { scope.spawn_fifo(move |scope| { + #[cfg(feature = "gecko")] gecko_profiler_label!(Layout, StyleComputation); let mut tlc = tls.ensure(create_thread_local_context); let mut context = StyleContext { @@ -92,7 +93,12 @@ fn distribute_one_chunk<'a, 'scope, E, D>( items, traversal_root, work_unit_max, - static_prefs::pref!("layout.css.stylo-local-work-queue.in-worker") as usize, + (|| { + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.stylo-local-work-queue.in-worker") as usize; + #[cfg(feature = "servo")] + return 0; + })(), traversal_data, Some(scope), traversal,