refactor(tvix/eval): Box the strings in CatchableErrorKind

These strings are allocated once and never changed, so they don't need
the additional overhead of a capacity given by String - instead, we can
use Box<str> and save on 16 bytes for each of these, *and* for each
Value since this is currently the largest Value variant.

Change-Id: I3e5cb070fe6c5bf82114c92d04f6bae775663a7e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10796
Autosubmit: aspen <root@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Aspen Smith 2024-02-10 12:22:59 -05:00 committed by clbot
parent 5d2ae840f1
commit 5d72d3980f
3 changed files with 14 additions and 13 deletions

View file

@ -138,10 +138,13 @@ impl NixSearchPath {
return Ok(Ok(p));
}
}
Ok(Err(CatchableErrorKind::NixPathResolution(format!(
"path '{}' was not found in the Nix search path",
path.display()
))))
Ok(Err(CatchableErrorKind::NixPathResolution(
format!(
"path '{}' was not found in the Nix search path",
path.display()
)
.into_boxed_str(),
)))
}
}