forked from lix-project/lix
8168a4cf4a
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 |
||
---|---|---|
.. | ||
flake | ||
primops | ||
attr-path.cc | ||
attr-path.hh | ||
attr-set.cc | ||
attr-set.hh | ||
eval-cache.cc | ||
eval-cache.hh | ||
eval-inline.hh | ||
eval.cc | ||
eval.hh | ||
fetchurl.nix | ||
function-trace.cc | ||
function-trace.hh | ||
get-drvs.cc | ||
get-drvs.hh | ||
imported-drv-to-derivation.nix | ||
json-to-value.cc | ||
json-to-value.hh | ||
lexer.l | ||
local.mk | ||
nix-expr.pc.in | ||
nixexpr.cc | ||
nixexpr.hh | ||
parser.y | ||
primops.cc | ||
primops.hh | ||
symbol-table.hh | ||
value-to-json.cc | ||
value-to-json.hh | ||
value-to-xml.cc | ||
value-to-xml.hh | ||
value.hh |