mirror of
https://github.com/uutils/awk.git
synced 2026-06-10 16:15:04 -07:00
perf: switch to ahash, indexmap-allocator-api
This commit is contained in:
@@ -14,6 +14,7 @@ smallvec.workspace = true
|
||||
bumpalo.workspace = true
|
||||
hashbrown.workspace = true
|
||||
allocator-api2.workspace = true
|
||||
ahash.workspace = true
|
||||
ariadne = "0.6.0"
|
||||
|
||||
[lints]
|
||||
|
||||
+3
-2
@@ -5,9 +5,10 @@
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use ahash::RandomState;
|
||||
use bumpalo::{Bump, boxed::Box, collections::Vec};
|
||||
use either::Either;
|
||||
use hashbrown::{DefaultHashBuilder, HashMap};
|
||||
use hashbrown::HashMap;
|
||||
use lexer::{Slice, Span, Token};
|
||||
|
||||
use crate::{ParsingError, Result, lex::TokenExt};
|
||||
@@ -21,7 +22,7 @@ pub struct Ast<'a> {
|
||||
pub end_file: Vec<'a, Body<'a>>,
|
||||
pub rules: Vec<'a, Rule<'a>>,
|
||||
pub concurrent: Vec<'a, Rule<'a>>,
|
||||
pub functions: HashMap<Identifier<'a>, Function<'a>, DefaultHashBuilder, &'a Bump>,
|
||||
pub functions: HashMap<Identifier<'a>, Function<'a>, RandomState, &'a Bump>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ mod tests;
|
||||
|
||||
use std::{fmt::Debug, mem::replace};
|
||||
|
||||
use ahash::RandomState;
|
||||
use bumpalo::{Bump, boxed::Box, collections::Vec, vec};
|
||||
use either::Either::{Left, Right};
|
||||
use hashbrown::HashMap;
|
||||
@@ -685,7 +686,7 @@ impl<'a> Ast<'a> {
|
||||
end_file: Vec::new_in(arena),
|
||||
rules: Vec::new_in(arena),
|
||||
concurrent: Vec::new_in(arena),
|
||||
functions: HashMap::new_in(arena),
|
||||
functions: HashMap::with_hasher_in(RandomState::new(), arena),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user