Skip to content

Commit 7452976

Browse files
committed
Speed up compilation by 23%
Before this commit, serde_derive is built before serde. But serde does not depend on serde_derive, so that is not needed. Instead, build serde and serde_derive in parallel. That speeds up compilation by 23%. Before: $ hyperfine --prepare 'cargo clean' 'cargo build' Benchmark 1: cargo build Time (mean ± σ): 4.979 s ± 0.044 s [User: 4.887 s, System: 0.714 s] Range (min … max): 4.915 s … 5.068 s 10 runs After: $ hyperfine --prepare 'cargo clean' 'cargo build' Benchmark 1: cargo build Time (mean ± σ): 3.821 s ± 0.065 s [User: 5.083 s, System: 0.740 s] Range (min … max): 3.749 s … 3.955 s 10 runs
1 parent 129ba43 commit 7452976

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ repository = "https://github.com/rust-lang/rustdoc-types"
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
serde = {version="1", features=["derive"]}
11+
serde = {version="1"}
12+
serde_derive = {version="1"}
1213
rustc-hash = {version="2", optional=true}
1314

1415
[features]

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::path::PathBuf;
2121

2222
#[cfg(feature = "rustc-hash")]
2323
use rustc_hash::FxHashMap as HashMap;
24-
use serde::{Deserialize, Serialize};
24+
use serde_derive::{Deserialize, Serialize};
2525

2626

2727
/// The version of JSON output that this crate represents.

0 commit comments

Comments
 (0)