Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the number of dependencies #146

Merged
merged 3 commits into from
Sep 8, 2019
Merged

Reduce the number of dependencies #146

merged 3 commits into from
Sep 8, 2019

Conversation

koute
Copy link
Contributor

@koute koute commented Sep 7, 2019

  • I've updated to newer quick-xml which has less dependencies.
  • The rand dependency seems unnecessary considering what we need it for, so I just replaced it with a simple xorshift64 generator. As as side effect the RNG now always starts with the same seed.
  • I've gated the dependencies related to multithreading with a multithreaded feature flag.

cargo-tree before my changes (with --no-default-features):

inferno v0.8.0 (/tmp/inferno)
├── chashmap v2.2.2
│   ├── owning_ref v0.3.3
│   │   └── stable_deref_trait v1.1.1
│   └── parking_lot v0.4.8
│       ├── owning_ref v0.3.3 (*)
│       └── parking_lot_core v0.2.14
│           ├── libc v0.2.62
│           ├── rand v0.4.6
│           │   └── libc v0.2.62 (*)
│           └── smallvec v0.6.10
├── crossbeam v0.7.2
│   ├── cfg-if v0.1.9
│   ├── crossbeam-channel v0.3.9
│   │   └── crossbeam-utils v0.6.6
│   │       ├── cfg-if v0.1.9 (*)
│   │       └── lazy_static v1.4.0
│   ├── crossbeam-deque v0.7.1
│   │   ├── crossbeam-epoch v0.7.2
│   │   │   ├── arrayvec v0.4.11
│   │   │   │   └── nodrop v0.1.13
│   │   │   ├── cfg-if v0.1.9 (*)
│   │   │   ├── crossbeam-utils v0.6.6 (*)
│   │   │   ├── lazy_static v1.4.0 (*)
│   │   │   ├── memoffset v0.5.1
│   │   │   │   [build-dependencies]
│   │   │   │   └── rustc_version v0.2.3
│   │   │   │       └── semver v0.9.0
│   │   │   │           └── semver-parser v0.7.0
│   │   │   └── scopeguard v1.0.0
│   │   └── crossbeam-utils v0.6.6 (*)
│   ├── crossbeam-epoch v0.7.2 (*)
│   ├── crossbeam-queue v0.1.2
│   │   └── crossbeam-utils v0.6.6 (*)
│   └── crossbeam-utils v0.6.6 (*)
├── fnv v1.0.6
├── indexmap v1.1.0
├── itoa v0.4.4
├── lazy_static v1.4.0 (*)
├── log v0.4.8
│   └── cfg-if v0.1.9 (*)
├── num-format v0.4.0
│   ├── arrayvec v0.4.11 (*)
│   └── itoa v0.4.4 (*)
├── num_cpus v1.10.1
│   └── libc v0.2.62 (*)
├── quick-xml v0.15.0
│   ├── derive_more v0.14.1
│   │   ├── proc-macro2 v0.4.30
│   │   │   └── unicode-xid v0.1.0
│   │   ├── quote v0.6.13
│   │   │   └── proc-macro2 v0.4.30 (*)
│   │   └── syn v0.15.44
│   │       ├── proc-macro2 v0.4.30 (*)
│   │       ├── quote v0.6.13 (*)
│   │       └── unicode-xid v0.1.0 (*)
│   │   [build-dependencies]
│   │   └── rustc_version v0.2.3 (*)
│   ├── encoding_rs v0.8.19
│   │   └── cfg-if v0.1.9 (*)
│   ├── log v0.4.8 (*)
│   └── memchr v2.2.1
│       └── libc v0.2.62 (*)
├── rand v0.7.0
│   ├── getrandom v0.1.12
│   │   ├── cfg-if v0.1.9 (*)
│   │   └── libc v0.2.62 (*)
│   ├── libc v0.2.62 (*)
│   ├── rand_chacha v0.2.1
│   │   ├── c2-chacha v0.2.2
│   │   │   ├── lazy_static v1.4.0 (*)
│   │   │   └── ppv-lite86 v0.2.5
│   │   └── rand_core v0.5.1
│   │       └── getrandom v0.1.12 (*)
│   ├── rand_core v0.5.1 (*)
│   └── rand_pcg v0.2.0
│       └── rand_core v0.5.1 (*)
│       [build-dependencies]
│       └── autocfg v0.1.6
│   [dev-dependencies]
│   ├── rand_hc v0.2.0
│   │   └── rand_core v0.5.1 (*)
│   └── rand_pcg v0.2.0 (*)
├── rgb v0.8.14
└── str_stack v0.1.0

cargo-tree after my changes (with --no-default-features):

inferno v0.8.0 (/tmp/inferno)
├── fnv v1.0.6
├── indexmap v1.1.0
├── itoa v0.4.4
├── lazy_static v1.4.0
├── log v0.4.8
│   └── cfg-if v0.1.9
├── num-format v0.4.0
│   ├── arrayvec v0.4.11
│   │   └── nodrop v0.1.13
│   └── itoa v0.4.4 (*)
├── quick-xml v0.16.1
│   └── memchr v2.2.1
│       └── libc v0.2.62
├── rgb v0.8.14
└── str_stack v0.1.0

Whenever those dependencies are used is now controlled with
the `multithreaded` feature flag.
@jonhoo
Copy link
Owner

jonhoo commented Sep 8, 2019

Ah, this is excellent, thank you!

@jonhoo jonhoo merged commit 8371b95 into jonhoo:master Sep 8, 2019
@jonhoo
Copy link
Owner

jonhoo commented Sep 11, 2019

Released in 0.9.0 🚀

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

Successfully merging this pull request may close these issues.

2 participants