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

@ -9,7 +9,7 @@ fn test_empty_attrs() {
.unwrap();
assert!(
matches!(attrs, NixAttrs(AttrsRep::Empty)),
matches!(attrs.0.as_ref(), AttrsRep::Empty),
"empty attribute set should use optimised representation"
);
}
@ -21,7 +21,7 @@ fn test_simple_attrs() {
.unwrap();
assert!(
matches!(attrs, NixAttrs(AttrsRep::Im(_))),
matches!(attrs.0.as_ref(), AttrsRep::Map(_)),
"simple attribute set should use map representation",
)
}
@ -45,8 +45,8 @@ fn test_kv_attrs() {
.expect("constructing K/V pair attrs should succeed")
.unwrap();
match kv_attrs {
NixAttrs(AttrsRep::KV { name, value })
match kv_attrs.0.as_ref() {
AttrsRep::KV { name, value }
if name.to_str().unwrap() == meaning_val.to_str().unwrap()
|| value.to_str().unwrap() == forty_two_val.to_str().unwrap() => {}