Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print stats in more programs #2391

Merged
merged 2 commits into from Sep 1, 2018
Merged

Print stats in more programs #2391

merged 2 commits into from Sep 1, 2018

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Sep 1, 2018

works on failed builds:

[nix-shell:~/projects/nix]$ NIX_SHOW_STATS=1 ./inst/bin/nix-build ../test.nix 
evaluation statistics:
  time elapsed: 0.090999
  size of a value: 24
  size of an attr: 24
  environments allocated count: 4811
  environments allocated bytes: 135936
  list elements count: 3770
  list elements bytes: 30160
  list concatenations: 17
  values allocated count: 26697
  values allocated bytes: 640728
  sets allocated: 2034 (2094960 bytes)
  right-biased unions: 251
  values copied in right-biased unions: 63015
  symbols in symbol table: 12782
  size of symbol table: 156784
  number of thunks: 23295
  number of thunks avoided: 6495
  number of attr lookups: 906
  number of primop calls: 2480
  number of function calls: 4284
  total allocations: 2901784 bytes
  current Boehm heap size: 402718720 bytes
  total Boehm heap allocations: 3186896 bytes
these derivations will be built:
  /nix/store/d2vrs4sgs3caxv2pldy0gli6l20lk50i-hi.drv
building '/nix/store/d2vrs4sgs3caxv2pldy0gli6l20lk50i-hi.drv'...
builder for '/nix/store/d2vrs4sgs3caxv2pldy0gli6l20lk50i-hi.drv' failed to produce output path '/nix/store/2sznz356r0j7215srdppwzi830v98hd5-hi'
error: build of '/nix/store/d2vrs4sgs3caxv2pldy0gli6l20lk50i-hi.drv' failed

nix shell:

$ NIX_SHOW_STATS=1 ./inst/bin/nix-shell ../test.nix -A a
evaluation statistics:
  time elapsed: 0.091844
  size of a value: 24
  size of an attr: 24
  environments allocated count: 4831
  environments allocated bytes: 136856
  list elements count: 3772
  list elements bytes: 30176
  list concatenations: 17
  values allocated count: 26751
  values allocated bytes: 642024
  sets allocated: 2054 (2101552 bytes)
  right-biased unions: 261
  values copied in right-biased unions: 63223
  symbols in symbol table: 12782
  size of symbol table: 156774
  number of thunks: 23345
  number of thunks avoided: 6539
  number of attr lookups: 917
  number of primop calls: 2485
  number of function calls: 4300
  total allocations: 2910608 bytes
  current Boehm heap size: 402718720 bytes
  total Boehm heap allocations: 3197488 bytes

dry runs:

]$ NIX_SHOW_STATS=1 ./inst/bin/nix-build ../test.nix  -A a --dry-run
evaluation statistics:
  time elapsed: 0.091129
  size of a value: 24
  size of an attr: 24
  environments allocated count: 4831
  environments allocated bytes: 136856
  list elements count: 3772
  list elements bytes: 30176
  list concatenations: 17
  values allocated count: 26751
  values allocated bytes: 642024
  sets allocated: 2054 (2101552 bytes)
  right-biased unions: 261
  values copied in right-biased unions: 63223
  symbols in symbol table: 12782
  size of symbol table: 156774
  number of thunks: 23345
  number of thunks avoided: 6539
  number of attr lookups: 917
  number of primop calls: 2485
  number of function calls: 4300
  total allocations: 2910608 bytes
  current Boehm heap size: 402718720 bytes
  total Boehm heap allocations: 3197488 bytes
these derivations will be built:
  /nix/store/ndig663m5626mlqfkr1i0bgnlmv3kg3m-hi.drv

successfull builds:

$ NIX_SHOW_STATS=1 ./inst/bin/nix-build  ../test.nix
evaluation statistics:
  time elapsed: 0.094896
  size of a value: 24
  size of an attr: 24
  environments allocated count: 4811
  environments allocated bytes: 135936
  list elements count: 3770
  list elements bytes: 30160
  list concatenations: 17
  values allocated count: 26698
  values allocated bytes: 640752
  sets allocated: 2035 (2094992 bytes)
  right-biased unions: 251
  values copied in right-biased unions: 63015
  symbols in symbol table: 12783
  size of symbol table: 156799
  number of thunks: 23296
  number of thunks avoided: 6495
  number of attr lookups: 906
  number of primop calls: 2480
  number of function calls: 4284
  total allocations: 2901840 bytes
  current Boehm heap size: 402718720 bytes
  total Boehm heap allocations: 3186896 bytes
these derivations will be built:
  /nix/store/70dbsncklmss52zl050j35m0d3z0gvkr-hi.drv
building '/nix/store/70dbsncklmss52zl050j35m0d3z0gvkr-hi.drv'...
/nix/store/zc95dfzrlf12dk4pvapnj427qa599sdl-hi

helpful for debugging big evals in nixops according to @cleverca22.

@edolstra edolstra merged commit 254ed7f into NixOS:master Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants