Enable lto in benchmarks
This commit is contained in:
parent
70450dbcdc
commit
964a84df45
|
@ -6,3 +6,6 @@ edition = "2021"
|
|||
[dependencies]
|
||||
itertools = "0.10"
|
||||
paste = "1.0"
|
||||
|
||||
[profile.bench]
|
||||
lto = true
|
||||
|
|
|
@ -39,6 +39,7 @@ fn part2(parsed: &Parsed, bits: usize) -> usize {
|
|||
let gamma = most_common_at(&matching_gamma, i);
|
||||
let epsilon = !most_common_at(&matching_epsilon, i);
|
||||
// TODO: Find out why retain is significantly slower than filter().collect()
|
||||
// Update: Let’s see what the maintainers say: https://github.com/rust-lang/rust/issues/91497
|
||||
// matching_gamma.retain(|&n| bit_at(n, i) == gamma);
|
||||
matching_gamma = matching_gamma.into_iter().filter(|&n| bit_at(n, i) == gamma).collect();
|
||||
if matching_epsilon.len() > 1 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user