Skip to content
This repository was archived by the owner on Aug 29, 2020. It is now read-only.

Switch from serde to miniserde for Compile Times #91

Open
CosmicHorrorDev opened this issue Jun 27, 2020 · 0 comments
Open

Switch from serde to miniserde for Compile Times #91

CosmicHorrorDev opened this issue Jun 27, 2020 · 0 comments

Comments

@CosmicHorrorDev
Copy link

I was wondering how open you would be about switching from serde to miniserde for json deserialization. The overall code change would be tiny for a significant change in compile times. I went ahead and timed a single job compile for each case on my laptop (Intel i5-5200U @ 2.7GHz) and the difference seems pretty significant. (Each run should have been cold and I compiled the version with miniserde before the current master with a full cargo clean between so there shouldn't be any caching affecting this)

serde (Total: 670.52 seconds)

ytop git/master
❯ cargo bloat -j 1 --time --release
  Time Crate
72.11s syn
54.14s serde_derive
46.00s clap
45.14s snafu_derive
43.28s uom
39.36s structopt_derive
28.30s ytop
27.77s derive_more
22.81s regex_syntax
21.64s psutil
20.14s syn_mid
16.12s nix
14.05s regex
12.81s serde
12.42s cc
10.44s tui
10.30s num_bigint
 9.68s serde_json
--- 8< --- snip --- 8< ---
 0.06s cfg_if

miniserde (Total: 466.63)

ytop git/master*
❯ cargo bloat -j 1 --time --release
  Time Crate
53.66s syn
36.12s uom
34.84s derive_more
30.47s structopt_derive
30.23s clap
29.76s snafu_derive
25.32s mini_internal
20.21s ytop
16.07s regex_syntax
13.74s psutil
13.27s syn_mid
11.51s regex
10.64s nix
 7.84s cc
 7.24s proc_macro_error_attr
 6.83s tui
 6.54s num_bigint
 6.20s proc_macro2
 5.28s cassowary
 5.25s crossterm
 5.10s libc
 4.40s chrono
 4.11s fern
 3.79s mio
 3.43s console
 3.20s miniserde
--- 8< --- snip --- 8< ---
 0.06s cfg_if

Even though this was a single job build there should still be a significant difference in multithreaded build times. I just a single job since it seemed like the cleanest metric to choose.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant