about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-02-03T09·25+0300
committertazjin <tazjin@tvl.su>2023-02-03T18·47+0000
commitf16b0f24e2f7c360b1daf7ae7b8e3341907faf76 (patch)
tree831f17857e1e1b1eb64a5d91552a0899184cafaf /tvix/eval/src/builtins
parent32698766ef05c1c5f65a2fdbb8d08c558d793dec (diff)
refactor(tvix/eval): wrap `Builtin` type in a Box r/5832
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>
Diffstat (limited to 'tvix/eval/src/builtins')
0 files changed, 0 insertions, 0 deletions