mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Auto merge of #14600 - upsuper:parallel-bindgen, r=bholley
Parallelize build-time bindgen When there is nothing else is being compiled, this cuts the time consumption of running the bindgen part by more than half. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14600) <!-- Reviewable:end -->
This commit is contained in:
commit
04d9ab50eb
1 changed files with 9 additions and 3 deletions
|
@ -617,8 +617,14 @@ mod bindings {
|
|||
pub fn generate() {
|
||||
use self::common::*;
|
||||
use std::fs;
|
||||
use std::thread;
|
||||
fs::create_dir_all(&*OUTDIR_PATH).unwrap();
|
||||
bindings::generate_structs(BuildType::Debug);
|
||||
bindings::generate_structs(BuildType::Release);
|
||||
bindings::generate_bindings();
|
||||
let threads = vec![
|
||||
thread::spawn(|| bindings::generate_structs(BuildType::Debug)),
|
||||
thread::spawn(|| bindings::generate_structs(BuildType::Release)),
|
||||
thread::spawn(|| bindings::generate_bindings()),
|
||||
];
|
||||
for t in threads.into_iter() {
|
||||
t.join().unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue