Bump rayon to 1.0

This commit is contained in:
Bastien Orivel 2018-02-16 02:58:54 +01:00
parent cccca27f4f
commit fae2d9839f
8 changed files with 133 additions and 95 deletions

View file

@ -31,7 +31,7 @@ ordered-float = "0.4"
parking_lot = "0.4"
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
rayon = "0.8"
rayon = "1"
script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"}
selectors = { path = "../selectors" }

View file

@ -33,7 +33,7 @@ net_traits = {path = "../net_traits"}
parking_lot = "0.4"
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
rayon = "0.8"
rayon = "1"
script = {path = "../script"}
script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"}

View file

@ -457,11 +457,12 @@ impl LayoutThread {
opts::get().initial_window_size.to_f32() * TypedScale::new(1.0),
TypedScale::new(opts::get().device_pixels_per_px.unwrap_or(1.0)));
let configuration =
rayon::Configuration::new().num_threads(layout_threads)
.start_handler(|_| thread_state::initialize_layout_worker_thread());
let workers =
rayon::ThreadPoolBuilder::new().num_threads(layout_threads)
.start_handler(|_| thread_state::initialize_layout_worker_thread())
.build();
let parallel_traversal = if layout_threads > 1 {
Some(rayon::ThreadPool::new(configuration).expect("ThreadPool creation failed"))
Some(workers.expect("ThreadPool creation failed"))
} else {
None
};
@ -708,7 +709,7 @@ impl LayoutThread {
let mut txn = webrender_api::Transaction::new();
txn.scroll_node_with_id(
webrender_api::LayoutPoint::from_untyped(&point),
webrender_api::ScrollNodeIdType::ExternalScrollId(state.scroll_id),
state.scroll_id,
webrender_api::ScrollClamping::ToContentBounds
);
self.webrender_api.send_transaction(self.webrender_document, txn);

View file

@ -54,7 +54,7 @@ ordered-float = "0.4"
owning_ref = "0.3.3"
parking_lot = "0.4"
precomputed-hash = "0.1.1"
rayon = "0.8.2"
rayon = "1"
selectors = { path = "../selectors" }
serde = {version = "1.0", optional = true, features = ["derive"]}
servo_arc = { path = "../servo_arc" }

View file

@ -85,7 +85,7 @@ lazy_static! {
let pool = if num_threads < 1 || unsafe { !bindings::Gecko_ShouldCreateStyleThreadPool() } {
None
} else {
let configuration = rayon::Configuration::new()
let workers = rayon::ThreadPoolBuilder::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
@ -96,9 +96,9 @@ lazy_static! {
.thread_name(thread_name)
.start_handler(thread_startup)
.exit_handler(thread_shutdown)
.stack_size(STYLE_THREAD_STACK_SIZE_KB * 1024);
let pool = rayon::ThreadPool::new(configuration).ok();
pool
.stack_size(STYLE_THREAD_STACK_SIZE_KB * 1024)
.build();
workers.ok()
};
StyleThreadPool {