From 5f0e5855d04eda6a00e2ff7a9362154623da8c9c Mon Sep 17 00:00:00 2001 From: WangXi Date: Sat, 21 Nov 2020 01:15:52 +0800 Subject: [PATCH] perf: use better FxHash instead of aHash to speed up circuit computation --- Cargo.toml | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 45ad5023c..177a325bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ rand = "0.7" rayon = "1.3.0" memmap = "0.7.0" thiserror = "1.0.10" -ahash = "0.5.6" +rustc-hash = "1.1.0" num_cpus = "1" crossbeam-channel = "0.5.0" diff --git a/src/lib.rs b/src/lib.rs index 7370efec3..713b42c9a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -151,7 +151,7 @@ pub mod multiexp; pub mod util_cs; use ff::{Field, ScalarEngine}; -use ahash::AHashMap as HashMap; +use rustc_hash::FxHashMap as HashMap; use std::io; use std::marker::PhantomData; use std::ops::{Add, Sub}; @@ -205,7 +205,7 @@ impl Default for LinearCombination { impl LinearCombination { pub fn zero() -> LinearCombination { - LinearCombination(HashMap::new()) + LinearCombination(HashMap::default()) } pub fn iter(&self) -> impl Iterator + '_ {