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

Use fnv instead of ahash. #87

Merged
merged 1 commit into from
Aug 16, 2022
Merged

Use fnv instead of ahash. #87

merged 1 commit into from
Aug 16, 2022

Conversation

Anders429
Copy link
Owner

Resolves #86. This reduces the dependency tree quite a bit, since randomness is not actually needed. All of the hashing is done internally, unrelated to user input, so HashDoS attacks are not a concern. See #86 for more details on the reasoning behind this.

@codecov-commenter
Copy link

codecov-commenter commented Aug 16, 2022

Codecov Report

Merging #87 (1743c30) into master (65ace8e) will decrease coverage by 0.03%.
The diff coverage is 27.65%.

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
- Coverage   39.97%   39.94%   -0.04%     
==========================================
  Files          56       56              
  Lines        5973     5970       -3     
==========================================
- Hits         2388     2385       -3     
  Misses       3585     3585              
Impacted Files Coverage Δ
src/entities/seal/storage.rs 0.00% <0.00%> (ø)
src/entity/seal/storage.rs 0.00% <0.00%> (ø)
src/query/claim.rs 0.00% <0.00%> (ø)
src/query/filter/seal.rs 0.00% <0.00%> (ø)
src/query/result/iter.rs 0.00% <0.00%> (ø)
src/query/result/par_iter.rs 0.00% <0.00%> (ø)
src/query/view/par/seal/mod.rs 0.00% <0.00%> (ø)
src/query/view/seal.rs 0.00% <0.00%> (ø)
src/system/schedule/builder.rs 0.00% <0.00%> (ø)
src/system/schedule/raw_task/seal.rs 0.00% <0.00%> (ø)
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Anders429
Copy link
Owner Author

Everything looks good here. I ran ecs_bench_suite and found a few performance improvements (simple_insert, fragmented_iter, add_remove_component, serialize_text, and serialize_binary all saw improvements). The size of the dependency tree is reduced a bit, looking like this:

$ cargo tree
brood v0.1.0
├── either v1.7.0
├── fnv v1.0.7
└── hashbrown v0.12.3

and

$ cargo tree --all-features
brood v0.1.0
├── either v1.7.0
├── fnv v1.0.7
├── hashbrown v0.12.3
│   └── rayon v1.5.3
│       ├── crossbeam-deque v0.8.1
│       │   ├── cfg-if v1.0.0
│       │   ├── crossbeam-epoch v0.9.9
│       │   │   ├── cfg-if v1.0.0
│       │   │   ├── crossbeam-utils v0.8.10
│       │   │   │   ├── cfg-if v1.0.0
│       │   │   │   └── once_cell v1.12.1
│       │   │   ├── memoffset v0.6.5
│       │   │   │   [build-dependencies]
│       │   │   │   └── autocfg v1.0.1
│       │   │   ├── once_cell v1.12.1
│       │   │   └── scopeguard v1.1.0
│       │   │   [build-dependencies]
│       │   │   └── autocfg v1.0.1
│       │   └── crossbeam-utils v0.8.10 (*)
│       ├── either v1.7.0
│       └── rayon-core v1.9.3
│           ├── crossbeam-channel v0.5.5
│           │   ├── cfg-if v1.0.0
│           │   └── crossbeam-utils v0.8.10 (*)
│           ├── crossbeam-deque v0.8.1 (*)
│           ├── crossbeam-utils v0.8.10 (*)
│           └── num_cpus v1.13.1
│               └── libc v0.2.126
│       [build-dependencies]
│       └── autocfg v1.0.1
├── rayon v1.5.3 (*)
└── serde v1.0.143

(with the dev-features omitted, of course).

Nice and clean. I like it.

@Anders429 Anders429 merged commit 3a0a447 into master Aug 16, 2022
@Anders429 Anders429 deleted the hash branch August 16, 2022 04:55
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.

Determine whether ahash is needed for all hashing situations.
2 participants