Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
base: 2aecc424f4db^
Choose a base ref
...
head repository: NixOS/nix
compare: d6773a361b04
Choose a head ref
  • 4 commits
  • 9 files changed
  • 1 contributor

Commits on Feb 21, 2020

  1. Copy the full SHA
    2aecc42 View commit details
    Browse the repository at this point in the history
  2. builtins.cache: Cache regular expressions

    The evaluator was spending about 1% of its time compiling a small
    number of regexes over and over again.
    edolstra committed Feb 21, 2020
    Copy the full SHA
    29f17a7 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2020

  1. Optimise Derivation::unparse()

    In
    
      nix-instantiate --dry-run '<nixpkgs/nixos/release-combined.nix>' -A nixos.tests.simple.x86_64-linux
    
    this reduces time spent in unparse() from 9.15% to 4.31%. The main
    culprit was appending characters one at a time to the destination
    string. Even though the string has enough capacity, push_back() still
    needs to check this on every call.
    edolstra committed Feb 23, 2020
    Copy the full SHA
    32c4696 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2020

  1. 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.
    edolstra committed Feb 24, 2020
    Copy the full SHA
    d6773a3 View commit details
    Browse the repository at this point in the history