about summary refs log tree commit diff
path: root/tvix/eval/src/vm
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-02-10T16·29-0500
committerclbot <clbot@tvl.fyi>2024-02-13T16·49+0000
commite3c92ac3b4b07a7397b565738ec4237b9bf621f6 (patch)
tree0cb85c787223782f3eb5fc628e7ffd0ed309f122 /tvix/eval/src/vm
parent24a089f87d8a80a2d31c5440b40f72ee466417e7 (diff)
fix(tvix/eval): Replace inner NixString repr with Box<Bstr> r/7506
Storing a full BString here incurs the extra overhead of the capacity
for the inner byte-vector, which we basically never use as Nix strings
are immutable (and we don't do any mutation / sharing analysis).
Switching to a Box<BStr> cuts us from 72 bytes to 64 bytes per
string (and there are a lot of strings!)

Change-Id: I11f34c14a08fa02759f260b1c78b2a2b981714e4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10794
Autosubmit: aspen <root@gws.fyi>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/vm')
-rw-r--r--tvix/eval/src/vm/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs
index 88d616fe3adc..6483122f96f6 100644
--- a/tvix/eval/src/vm/mod.rs
+++ b/tvix/eval/src/vm/mod.rs
@@ -558,7 +558,7 @@ where
                                 return frame.error(
                                     self,
                                     ErrorKind::AttributeNotFound {
-                                        name: (**key).clone().into_string_lossy()
+                                        name: key.to_str_lossy().into_owned()
                                     },
                                 );
                             }