diff --git a/Cargo.lock b/Cargo.lock index e6d7b364a..3c1d65530 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1538,6 +1538,7 @@ dependencies = [ "drk-sdk", "fast-socks5", "futures", + "fxhash", "group", "halo2_gadgets", "halo2_proofs", diff --git a/Cargo.toml b/Cargo.toml index 7962d3aed..637dda722 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,6 +61,7 @@ url = {version = "2.2.2", optional = true} dirs = {version = "4.0.0", optional = true} subtle = {version = "2.4.1", optional = true} lazy_static = {version = "1.4.0", optional = true} +fxhash = {version = "0.2.1", optional = true} indexmap = {version = "1.8.0", optional = true} itertools = {version = "0.10.3", optional = true} @@ -151,6 +152,7 @@ util = [ "serde_json", "dirs", "num-bigint", + "fxhash", ] rpc = [ diff --git a/src/zkas/parser.rs b/src/zkas/parser.rs index 547283d8b..1a0a98fcc 100644 --- a/src/zkas/parser.rs +++ b/src/zkas/parser.rs @@ -1,5 +1,6 @@ use std::{iter::Peekable, str::Chars}; +use fxhash::FxBuildHasher; use indexmap::IndexMap; use itertools::Itertools; @@ -43,7 +44,7 @@ impl Parser { // All the circuit statements let mut circuit_statements = vec![]; - let mut ast = IndexMap::new(); + let mut ast = IndexMap::with_hasher(FxBuildHasher::default()); let mut namespace = String::new(); let mut ast_inner = IndexMap::new(); let mut namespace_found = false; // Nasty