about summary refs log tree commit diff
path: root/tvix/eval/src/value/attrs/tests.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-12-29T14·08+0300
committertazjin <tazjin@tvl.su>2022-12-29T17·44+0000
commit91465dc78ec7b4a8c9b651657bb8ad5f25c556a7 (patch)
treeaaf6b3f624193de87b583b2cb5b0dcbdac89b4ea /tvix/eval/src/value/attrs/tests.rs
parent610c44ec1ec2eaf58e5c36d7007d6c1922e49804 (diff)
refactor(tvix/eval): persistent, memory-sharing OrdMap for NixAttrs r/5541
This uses the `im::OrdMap` for `NixAttrs` to enable sharing of memory
between different iterations of a map.

This slightly speeds up eval, but not significantly. Future work might
include benchmarking whether using a `HashMap` and only ordering in
cases where order is actually required would help.

This switches to a fork of `im` that fixes some bugs with its OrdMap
implementation.

Change-Id: I2f6a5ff471b6d508c1e8a98b13f889f49c0d9537
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7676
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/attrs/tests.rs')
-rw-r--r--tvix/eval/src/value/attrs/tests.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/value/attrs/tests.rs b/tvix/eval/src/value/attrs/tests.rs
index 2e80fa6f2308..2039c509fd56 100644
--- a/tvix/eval/src/value/attrs/tests.rs
+++ b/tvix/eval/src/value/attrs/tests.rs
@@ -56,7 +56,7 @@ fn test_simple_attrs() {
     .expect("simple attr construction should succeed");
 
     assert!(
-        matches!(attrs, NixAttrs(AttrsRep::Map(_))),
+        matches!(attrs, NixAttrs(AttrsRep::Im(_))),
         "simple attribute set should use map representation",
     )
 }