snix/tvix/eval/src
Vincent Ambo f16b0f24e2 refactor(tvix/eval): wrap Builtin type in a Box
This reduces the size of `Builtin` from 88 (!) bytes to 8, and as the
largest variant of `Value`, the size of that type from 96 to 64.

The next largest type is NixList, clocking in at 64 bytes.

This has noticeable performance impact. In an implementation without
disk I/O, evaluating nixpkgs.stdenv looks like this:

Benchmark 1: tvix -E '(import <nixpkgs> {}).stdenv.drvPath'
  Time (mean ± σ):      1.151 s ±  0.003 s    [User: 1.041 s, System: 0.109 s]
  Range (min … max):    1.147 s …  1.155 s    10 runs

After this change, it looks like this:

Benchmark 1: tvix -E '(import <nixpkgs> {}).stdenv.drvPath'
  Time (mean ± σ):      1.046 s ±  0.004 s    [User: 0.954 s, System: 0.092 s]
  Range (min … max):    1.041 s …  1.053 s    10 runs

Change-Id: I5ab7cc02a9a450c0227daf1f1f72966358311ebb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8027
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2023-02-03 18:47:33 +00:00
..
builtins fix(tvix/eval): ensure all evaluated thunks are correctly memoized 2023-02-03 10:47:18 +00:00
compiler refactor(tvix/eval): statically resolve select from constant attrs 2023-02-03 18:47:33 +00:00
tests fix(tvix/eval): ensure all evaluated thunks are correctly memoized 2023-02-03 10:47:18 +00:00
value refactor(tvix/eval): wrap Builtin type in a Box 2023-02-03 18:47:33 +00:00
chunk.rs refactor(tvix/eval): administer antidote for poison 2023-01-21 10:19:15 +00:00
errors.rs feat(tvix/eval): implement builtins.fromTOML 2023-01-25 07:49:44 +00:00
io.rs feat(tvix/eval): use EvalIO::import_path when coercing paths 2022-12-21 22:59:18 +00:00
lib.rs feat(tvix/eval): support builtins implemented in Nix itself 2023-01-22 20:48:53 +00:00
nix_search_path.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
observer.rs feat(tvix/eval): initial attempt at setting lambda names 2022-10-23 15:58:53 +00:00
opcode.rs refactor(tvix/eval): administer antidote for poison 2023-01-21 10:19:15 +00:00
pretty_ast.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
properties.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
source.rs chore(tvix/eval): implement std::error::Error for tvix_eval::Error 2023-01-02 22:24:43 +00:00
spans.rs refactor(tvix/eval): add a LightSpan type for lighter span tracking 2022-12-21 22:21:25 +00:00
systems.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
test_utils.rs test(tvix/eval): Add proof-of-concept test for Chunk 2022-09-18 17:55:06 +00:00
upvalues.rs fix(tvix/eval): remove impl PartialEq for Value 2022-11-04 00:30:13 +00:00
vm.rs fix(tvix/eval): ensure all evaluated thunks are correctly memoized 2023-02-03 10:47:18 +00:00
warnings.rs chore(tvix/eval): delete "useless parenthesis" warning/optimisation 2023-01-23 17:59:06 +00:00