lix/src/libexpr
pennae 8168a4cf4a shrink Attr by 8 bytes on 64bit machines
with position and symbol tables in place we can now shrink Attr by a full
pointer with some simple field reordering. since Attr is a very hot struct this
has substantial impact on memory use, decreasing GC allocations and heap size by
10-15% each. we also get a ~15% performance improvement due to reduced GC
loading.

pure parsing has taken a hit over the branch base because positions are now
slightly more expensive to create, but overall we get a noticeable improvement.

before (on memory-friendliness):

  Benchmark 1: nix search --no-eval-cache --offline ../nixpkgs hello
    Time (mean ± σ):      6.960 s ±  0.028 s    [User: 5.832 s, System: 0.897 s]
    Range (min … max):    6.886 s …  7.005 s    20 runs

  Benchmark 2: nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
    Time (mean ± σ):     328.1 ms ±   1.7 ms    [User: 295.8 ms, System: 32.2 ms]
    Range (min … max):   324.9 ms … 331.2 ms    20 runs

  Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
    Time (mean ± σ):      2.688 s ±  0.029 s    [User: 2.365 s, System: 0.238 s]
    Range (min … max):    2.642 s …  2.742 s    20 runs

after:

  Benchmark 1: nix search --no-eval-cache --offline ../nixpkgs hello
    Time (mean ± σ):      6.902 s ±  0.039 s    [User: 5.844 s, System: 0.783 s]
    Range (min … max):    6.820 s …  6.956 s    20 runs

  Benchmark 2: nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
    Time (mean ± σ):     330.7 ms ±   2.2 ms    [User: 300.6 ms, System: 30.0 ms]
    Range (min … max):   327.5 ms … 334.5 ms    20 runs

  Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
    Time (mean ± σ):      2.330 s ±  0.027 s    [User: 2.040 s, System: 0.234 s]
    Range (min … max):    2.272 s …  2.383 s    20 runs
2022-04-21 21:56:34 +02:00
..
flake store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
primops store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
attr-path.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
attr-path.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
attr-set.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
attr-set.hh shrink Attr by 8 bytes on 64bit machines 2022-04-21 21:56:34 +02:00
eval-cache.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
eval-cache.hh store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
eval-inline.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
eval.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
eval.hh store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
fetchurl.nix Move <nix/fetchurl.nix> into the nix binary 2020-12-22 14:43:20 +01:00
function-trace.cc Revert the enum struct change 2020-06-18 22:11:26 +00:00
function-trace.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
get-drvs.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
get-drvs.hh nix-env: always print output names in JSON and XML 2022-03-16 21:26:19 +01:00
imported-drv-to-derivation.nix Move some corepkgs into the nix binary 2020-03-11 16:57:48 +01:00
json-to-value.cc return string_views from forceString* 2022-01-27 17:15:43 +01:00
json-to-value.hh return string_views from forceString* 2022-01-27 17:15:43 +01:00
lexer.l replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
local.mk Merge pull request #5175 from Pamplemousse/make 2021-08-30 12:44:29 +02:00
nix-expr.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
nixexpr.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
nixexpr.hh store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
parser.y store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
primops.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
primops.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
symbol-table.hh store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
value-to-json.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
value-to-json.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
value-to-xml.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
value-to-xml.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
value.hh store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00