Skip to content

Commit

Permalink
Enforce usage of FxHash
Browse files Browse the repository at this point in the history
  • Loading branch information
ricohageman committed Dec 8, 2023
1 parent a13cca3 commit 3f48b14
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ test_lib = []
gcd = "2.3.0"
itertools = "0.12.0"
pico-args = "0.5.0"
rustc-hash = { version = "1.1.0", features = [] }
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.

| Day | Part 1 | Part 2 |
| :---: | :---: | :---: |
| [Day 1](./src/bin/01.rs) | `70.9µs` | `848.4µs` |
| [Day 2](./src/bin/02.rs) | `37.7µs` | `48.4µs` |
| [Day 3](./src/bin/03.rs) | `500.7µs` | `487.2µs` |
| [Day 4](./src/bin/04.rs) | `238.1µs` | `239.4µs` |
| [Day 5](./src/bin/05.rs) | `20.5µs` | `74.7µs` |
| [Day 6](./src/bin/06.rs) | `456.0ns` | `385.0ns` |
| [Day 7](./src/bin/07.rs) | `289.8µs` | `291.3µs` |
| [Day 8](./src/bin/08.rs) | `506.5µs` | `3.3ms` |

**Total: 6.95ms**
| [Day 1](./src/bin/01.rs) | `69.8µs` | `847.4µs` |
| [Day 2](./src/bin/02.rs) | `38.2µs` | `49.6µs` |
| [Day 3](./src/bin/03.rs) | `231.7µs` | `245.9µs` |
| [Day 4](./src/bin/04.rs) | `199.2µs` | `195.5µs` |
| [Day 5](./src/bin/05.rs) | `20.2µs` | `74.1µs` |
| [Day 6](./src/bin/06.rs) | `489.0ns` | `399.0ns` |
| [Day 7](./src/bin/07.rs) | `287.6µs` | `287.9µs` |
| [Day 8](./src/bin/08.rs) | `274.1µs` | `1.6ms` |

**Total: 4.42ms**
<!--- benchmarking table --->

---
Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disallowed-types = ["std::collections::HashMap", "std::collections::HashSet"]
2 changes: 1 addition & 1 deletion src/bin/03.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use itertools::Itertools;
use std::collections::{HashMap, HashSet};
use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet };
advent_of_code::solution!(3);

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/bin/04.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashSet;
use rustc_hash::FxHashSet as HashSet;
advent_of_code::solution!(4);

fn number_of_winning_numbers_per_game(input: &str) -> impl Iterator<Item = usize> + '_ {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/08.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use gcd::Gcd;
use std::collections::HashMap;
use rustc_hash::FxHashMap as HashMap;
advent_of_code::solution!(8);

#[derive(Copy, Clone, Debug)]
Expand Down

0 comments on commit 3f48b14

Please sign in to comment.