Skip to content

Commit

Permalink
style: Cap the number of style threads at six.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D1928
Bug: 1431285
Reviewed-by: emilio
  • Loading branch information
bholley authored and emilio committed Jul 9, 2018
1 parent c23dca8 commit 50a85a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/style/gecko/global_style_data.rs
Expand Up @@ -65,7 +65,12 @@ lazy_static! {
.map(|s| s.parse::<usize>().expect("invalid STYLO_THREADS value")); .map(|s| s.parse::<usize>().expect("invalid STYLO_THREADS value"));
let mut num_threads = match stylo_threads { let mut num_threads = match stylo_threads {
Ok(num) => num, Ok(num) => num,
_ => cmp::max(num_cpus::get() * 3 / 4, 1), // The default heuristic is num_virtual_cores * .75. This gives us
// three threads on a hyper-threaded dual core, and six threads on
// a hyper-threaded quad core. The performance benefit of additional
// threads seems to level off at around six, so we cap it there on
// many-core machines (see bug 1431285 comment 14).
_ => cmp::min(cmp::max(num_cpus::get() * 3 / 4, 1), 6),
}; };


// If num_threads is one, there's no point in creating a thread pool, so // If num_threads is one, there's no point in creating a thread pool, so
Expand Down

0 comments on commit 50a85a5

Please sign in to comment.