lix/src/libexpr
Eelco Dolstra 81e7c40264 Optimize primop calls
We now parse function applications as a vector of arguments rather
than as a chain of binary applications, e.g. 'substring 1 2 "foo"' is
parsed as

  ExprCall { .fun = <substring>, .args = [ <1>, <2>, <"foo"> ] }

rather than

  ExprApp (ExprApp (ExprApp <substring> <1>) <2>) <"foo">

This allows primops to be called immediately (if enough arguments are
supplied) without having to allocate intermediate tPrimOpApp values.

On

  $ nix-instantiate --dry-run '<nixpkgs/nixos/release-combined.nix>' -A nixos.tests.simple.x86_64-linux

this gives a substantial performance improvement:

  user CPU time:      median =      0.9209  mean =      0.9218  stddev =      0.0073  min =      0.9086  max =      0.9340  [rejected, p=0.00000, Δ=-0.21433±0.00677]
  elapsed time:       median =      1.0585  mean =      1.0584  stddev =      0.0024  min =      1.0523  max =      1.0623  [rejected, p=0.00000, Δ=-0.20594±0.00236]

because it reduces the number of tPrimOpApp allocations from 551990 to
42534 (i.e. only small minority of primop calls are partially
applied) which in turn reduces time spent in the garbage collector.
2021-11-04 15:03:40 +01:00
..
flake Make experimental-features a proper type 2021-10-26 07:02:31 +02:00
primops Tweak fetchTree docs 2021-10-26 14:21:24 +02:00
attr-path.cc Rename findDerivationFilename -> findPackageFilename 2021-07-19 18:10:10 +02:00
attr-path.hh Rename findDerivationFilename -> findPackageFilename 2021-07-19 18:10:10 +02:00
attr-set.cc Replace Value type setters with mk* functions 2020-12-18 21:48:22 +01:00
attr-set.hh Force all Pos* to be non-null 2021-08-29 18:11:58 +02:00
common-eval-args.cc Support --eval-store in nix-instantiate and nix-build 2021-07-22 09:59:51 +02:00
common-eval-args.hh Support --eval-store in nix-instantiate and nix-build 2021-07-22 09:59:51 +02:00
eval-cache.cc libcmd/installables: force re-evaluation of cached failures 2021-04-19 19:51:04 +02:00
eval-cache.hh libcmd/installables: force re-evaluation of cached failures 2021-04-19 19:51:04 +02:00
eval-inline.hh Improve error formatting 2021-01-21 11:02:09 +01:00
eval.cc Optimize primop calls 2021-11-04 15:03:40 +01:00
eval.hh Optimize primop calls 2021-11-04 15:03:40 +01: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 Hide FunctionCallTrace constructor/destructor 2020-01-05 16:21:34 +01:00
get-drvs.cc Use BuildableReq for buildPaths and ensurePath 2021-04-05 08:33:00 -04:00
get-drvs.hh Squashed get CA derivations building 2020-08-07 19:51:55 +00: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 Bump nlohmann-json version to 3.9.1 2020-09-21 14:24:43 -04:00
json-to-value.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
lexer.l Optimize primop calls 2021-11-04 15:03:40 +01: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 Optimize primop calls 2021-11-04 15:03:40 +01:00
nixexpr.hh Optimize primop calls 2021-11-04 15:03:40 +01:00
parser.y Optimize primop calls 2021-11-04 15:03:40 +01:00
primops.cc StaticEnv: Use std::vector instead of std::map 2021-11-04 15:03:34 +01:00
primops.hh libexpr: throw a more helpful eval-error if a builtin is not available due to a missing feature-flag 2021-09-29 11:57:15 +02:00
symbol-table.hh nix flake show: Use evaluation cache 2020-04-17 01:02:29 +02:00
value-to-json.cc Rename Value::normalType() -> Value::type() 2020-12-17 14:45:45 +01:00
value-to-json.hh nix path-info: Add --json flag 2016-08-29 17:29:24 +02:00
value-to-xml.cc libexpr: remove matchAttrs boolean from ExprLambda 2021-10-06 17:24:06 +02:00
value-to-xml.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value.hh libexpr: misc improvements for proper error position 2021-04-13 23:12:38 +02:00