1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 23:28:26 -04:00
nix/src/libexpr
pennae 7d4cc5515c defer formals duplicate check for incresed efficiency all round
if we defer the duplicate argument check for lambda formals we can use more
efficient data structures for the formals set, and we can get rid of the
duplication of formals names to boot. instead of a list of formals we've seen
and a set of names we'll keep a vector instead and run a sort+dupcheck step
before moving the parsed formals into a newly created lambda. this improves
performance on search and rebuild by ~1%, pure parsing gains more (about 4%).

this does reorder lambda arguments in the xml output, but the output is still
stable. this shouldn't be a problem since argument order is not semantically
important anyway.

 before

  nix search --no-eval-cache --offline ../nixpkgs hello
    Time (mean ± σ):      8.550 s ±  0.060 s    [User: 6.470 s, System: 1.664 s]
    Range (min … max):    8.435 s …  8.666 s    20 runs

  nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
    Time (mean ± σ):     346.7 ms ±   2.1 ms    [User: 312.4 ms, System: 34.2 ms]
    Range (min … max):   343.8 ms … 353.4 ms    20 runs

  nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
    Time (mean ± σ):      2.720 s ±  0.031 s    [User: 2.415 s, System: 0.231 s]
    Range (min … max):    2.662 s …  2.780 s    20 runs

 after

  nix search --no-eval-cache --offline ../nixpkgs hello
    Time (mean ± σ):      8.462 s ±  0.063 s    [User: 6.398 s, System: 1.661 s]
    Range (min … max):    8.339 s …  8.542 s    20 runs

  nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
    Time (mean ± σ):     329.1 ms ±   1.4 ms    [User: 296.8 ms, System: 32.3 ms]
    Range (min … max):   326.1 ms … 330.8 ms    20 runs

  nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
    Time (mean ± σ):      2.687 s ±  0.035 s    [User: 2.392 s, System: 0.228 s]
    Range (min … max):    2.626 s …  2.754 s    20 runs
2022-01-19 17:07:29 +01:00
..
flake allow modifying lockfile commit msg with nix config option 2022-01-18 16:10:27 -07:00
primops Remove non-method mk<X> functions 2022-01-04 18:40:39 +01: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 Remove EvalState::mkAttrs() 2022-01-04 20:29:17 +01:00
attr-set.hh optimize removeAttrs builtin 2022-01-14 14:01:52 +01:00
common-eval-args.cc Remove non-method mkString() 2022-01-04 18:24:42 +01: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 defer formals duplicate check for incresed efficiency all round 2022-01-19 17:07:29 +01:00
eval.hh Merge pull request #5906 from pennae/primops-optimization 2022-01-18 19:43:28 +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 Ensure that attrsets are sorted 2022-01-04 18:00:33 +01: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 Remove EvalState::mkAttrs() 2022-01-04 20:29:17 +01:00
json-to-value.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
lexer.l remove ExprIndStr 2022-01-19 13:39:42 +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 avoid allocations in SymbolTable::create 2022-01-13 18:06:15 +01:00
nixexpr.hh defer formals duplicate check for incresed efficiency all round 2022-01-19 17:07:29 +01:00
parser.y defer formals duplicate check for incresed efficiency all round 2022-01-19 17:07:29 +01:00
primops.cc Merge pull request #5906 from pennae/primops-optimization 2022-01-18 19:43:28 +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 avoid allocations in SymbolTable::create 2022-01-13 18:06:15 +01:00
value-to-json.cc Support range-based for loop over list values 2021-11-25 16:31:39 +01:00
value-to-json.hh toJSON: report error position for fancier output 2021-10-25 21:17:52 +00:00
value-to-xml.cc defer formals duplicate check for incresed efficiency all round 2022-01-19 17:07:29 +01:00
value-to-xml.hh toXML: display errors position 2021-11-13 20:33:34 -05:00
value.hh optimize ExprConcatStrings::eval 2022-01-12 10:07:21 +01:00