refactor(tvix/eval): remove use of imbl::OrdMap

Removes imbl::OrdMap in favour of an Rc over the standard library's BTreeMap,
which allows us to drop the imbl dependency completely.

In my local tests this is actually slightly faster for `hello` and `firefox`.

Change-Id: Ic9597ead4e98bf9530f290c6a94a3c5c3efd0acc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12201
Reviewed-by: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2024-08-13 19:08:28 +03:00 committed by tazjin
parent adf9b4c54a
commit abff828ccc
8 changed files with 95 additions and 451 deletions

View file

@ -6,7 +6,6 @@
use bstr::{ByteSlice, ByteVec};
use builtin_macros::builtins;
use genawaiter::rc::Gen;
use imbl::OrdMap;
use regex::Regex;
use std::cmp::{self, Ordering};
use std::collections::BTreeMap;
@ -795,7 +794,7 @@ mod pure_builtins {
}
let mut right_keys = right_set.keys();
let mut out: OrdMap<NixString, Value> = OrdMap::new();
let mut out: BTreeMap<NixString, Value> = BTreeMap::new();
// Both iterators have at least one entry
let mut left = left_keys.next().unwrap();
@ -998,7 +997,7 @@ mod pure_builtins {
attrs: Value,
) -> Result<Value, ErrorKind> {
let attrs = attrs.to_attrs()?;
let mut out = imbl::OrdMap::new();
let mut out: BTreeMap<NixString, Value> = BTreeMap::new();
// the best span we can get…
let span = generators::request_span(&co).await;