nix-super/src/libexpr
Eelco Dolstra 4ccd48ce24 Add a "filter" primop
Evaluation of a NixOS configuration spends quite a lot of time in the
"filter" function in Nixpkgs.  As implemented in Nixpkgs, this is a
O(n^2) operation, so it's a good candidate for providing a more
efficient (i.e. primop) implementation.  Using it gives a ~10% speed
increase and a significant reduction in the number of evaluations.

Statistics before (on a NixOS system config):

  time elapsed: 1.3258
  size of a value: 24
  environments allocated: 1980939 (50127080 bytes)
  list elements: 14679308 (117434464 bytes)
  list concatenations: 50828
  values allocated: 2098938 (50374512 bytes)
  attribute sets allocated: 392040
  right-biased unions: 186334
  values copied in right-biased unions: 591137
  symbols in symbol table: 18271
  number of thunks: 1645752
  number of thunks avoided: 1921196
  number of attr lookups: 430798
  number of primop calls: 838807
  number of function calls: 1930107

Statistics after:

  time elapsed: 1.17982
  size of a value: 24
  environments allocated: 1543334 (39624560 bytes)
  list elements: 9612638 (76901104 bytes)
  list concatenations: 37434
  values allocated: 1854933 (44518392 bytes)
  attribute sets allocated: 392040
  right-biased unions: 186334
  values copied in right-biased unions: 591137
  symbols in symbol table: 18272
  number of thunks: 1392467
  number of thunks avoided: 1507311
  number of attr lookups: 430801
  number of primop calls: 691600
  number of function calls: 1492502
2012-08-13 00:28:08 -04:00
..
attr-path.cc Fix compilation on FreeBSD 2012-03-05 22:04:40 +01:00
attr-path.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
common-opts.cc Fix error message 2012-02-09 18:56:48 +01:00
common-opts.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
eval-inline.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
eval.cc Add a "filter" primop 2012-08-13 00:28:08 -04:00
eval.hh Add some more evaluations stats 2012-08-12 23:41:48 -04:00
get-drvs.cc * Inline some functions and get rid of the indirection through 2012-02-04 13:50:25 +00:00
get-drvs.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
lexer.l * Add a Nix expression search path feature. Paths between angle 2011-08-06 16:05:24 +00:00
Makefile.am * Inline some functions and get rid of the indirection through 2012-02-04 13:50:25 +00:00
names.cc * Export the nix-env derivation name parsing and version comparison 2008-07-01 10:10:32 +00:00
names.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
nix.sdf First attempt to update Nix SDF grammar to match the actual bison grammar 2008-06-04 14:36:46 +00:00
nixexpr.cc * Allow a default value in attribute selection by writing 2011-07-13 12:19:57 +00:00
nixexpr.hh Add some basic profiling support to the evaluator 2012-08-12 23:29:28 -04:00
parser.y Use Bison 2.5 2012-04-13 14:28:26 +02:00
primops.cc Add a "filter" primop 2012-08-13 00:28:08 -04:00
symbol-table.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value-to-xml.cc Fix compilation on FreeBSD 2012-03-05 22:04:40 +01:00
value-to-xml.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00