Add builtin function "partition"
The implementation of "partition" in Nixpkgs is O(n^2) (because of the use of ++), and for some reason was causing stack overflows in multi-threaded evaluation (not sure why). This reduces "nix-env -qa --drv-path" runtime by 0.197s and memory usage by 298 MiB (in non-Boehm mode).
Showing
- src/libexpr/eval.cc 2 additions, 0 deletionssrc/libexpr/eval.cc
- src/libexpr/eval.hh 2 additions, 1 deletionsrc/libexpr/eval.hh
- src/libexpr/json-to-value.cc 0 additions, 9 deletionssrc/libexpr/json-to-value.cc
- src/libexpr/primops.cc 35 additions, 0 deletionssrc/libexpr/primops.cc
- src/libexpr/value.hh 9 additions, 0 deletionssrc/libexpr/value.hh
- tests/lang/eval-okay-partition.exp 1 addition, 0 deletionstests/lang/eval-okay-partition.exp
- tests/lang/eval-okay-partition.nix 5 additions, 0 deletionstests/lang/eval-okay-partition.nix
Loading
Please register or sign in to comment