1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-08 10:01:01 +01:00
nix/src/libexpr
Sergei Zimmerman b36f8043d2 libexpr: Speed up BindingsBuilder::finishSizeIfNecessary
Instead of iterating over the newly built bindings we can
do a cheaper set_intersection to count duplicates or fall back
to a per-element binary search over the "base" bindings.

This speeds up `hello` evaluation by around 10ms (0.196s -> 0.187s) and
`nixos.closures.ec2.x86_64-linux` by 140ms (2.744s -> 2.609s).

This addresses a somewhat steep performance regression from 82315c3807
that reduced memory requirements of attribute set merges. With this patch
we get back around to 2.31 level of eval performance while keeping the memory
usage optimization.

Also document the optimization a bit more.

(cherry picked from commit ec2fd2dc23)
2025-10-27 14:40:17 +00:00
..
include/nix/expr libexpr: Speed up BindingsBuilder::finishSizeIfNecessary 2025-10-27 14:40:17 +00:00
pch libexpr: Speed up builds by using precompiled headers 2025-07-20 22:01:56 +03:00
primops Merge pull request #14050 from NixOS/fix-fetch-to-store-caching 2025-10-06 19:39:41 +02:00
value Apply clang-format universally. 2025-07-18 12:47:27 -04:00
.version Meson build for libexpr and libflake 2024-07-02 09:23:24 -04:00
attr-path.cc libexpr: Make emptyBindings a global constant 2025-09-11 01:51:48 +03:00
attr-set.cc libexpr: move eval memory allocation to own struct 2025-09-26 00:40:43 +03:00
eval-cache.cc libexpr: Statically allocate commonly used symbols 2025-08-31 13:24:06 +02:00
eval-error.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
eval-gc.cc libexpr: Fix build without Boehm 2025-09-12 04:02:07 +03:00
eval-profiler-settings.cc libutil: Include necessary headers in config-impl.hh 2025-08-11 20:44:27 +03:00
eval-profiler.cc libexpr: Use use-after-move in SampleStack::saveProfile() 2025-10-05 16:57:13 +03:00
eval-settings.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
eval.cc Merge pull request #14050 from NixOS/fix-fetch-to-store-caching 2025-10-06 19:39:41 +02:00
fetchurl.nix Format .nix files 2025-01-24 17:04:02 +01:00
function-trace.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
get-drvs.cc libexpr: Remove Bindings::find 2025-09-14 23:29:44 +03:00
imported-drv-to-derivation.nix Format .nix files 2025-01-24 17:04:02 +01:00
json-to-value.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
lexer-helpers.cc libexpr: Switch parser.y to %skeleton lalr1.cc 2025-09-29 00:58:41 +03:00
lexer-helpers.hh libexpr: Switch parser.y to %skeleton lalr1.cc 2025-09-29 00:58:41 +03:00
lexer.l libexpr: Switch parser.y to %skeleton lalr1.cc 2025-09-29 00:58:41 +03:00
meson.build fix cross-build for cygwin 2025-09-22 12:27:04 -03:00
meson.options meson: Apply formatting universally 2025-08-07 02:58:29 +03:00
nix-meson-build-support rename: build-utils-meson -> nix-meson-build-support 2024-12-09 16:54:42 +01:00
nixexpr.cc libexpr: allocate ExprSelect's AttrName vector in Expr::alloc 2025-10-03 22:51:23 +03:00
package.nix flake: Apply nixfmt 1.0.0 2025-08-18 20:29:45 +03:00
parser-scanner-decls.hh libexpr: Switch parser.y to %skeleton lalr1.cc 2025-09-29 00:58:41 +03:00
parser.y libexpr: allocate ExprOpHasAttr's AttrPath in Exprs::alloc 2025-10-03 23:26:41 +03:00
paths.cc Mount inputs on storeFS to restore fetchToStore() caching 2025-09-25 11:30:11 -04:00
primops.cc treewide: Remove toView() because it leads to segfaults when compiled with newer nixpkgs 2025-10-05 02:30:21 +03:00
print-ambiguous.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
print.cc treewide: Remove toView() because it leads to segfaults when compiled with newer nixpkgs 2025-10-05 02:30:21 +03:00
search-path.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
value-to-json.cc libexpr: Statically allocate commonly used symbols 2025-08-31 13:24:06 +02:00
value-to-xml.cc libexpr: Statically allocate commonly used symbols 2025-08-31 13:24:06 +02:00
value.cc libexpr: Make constant Values global constants, move out of EvalState 2025-09-11 01:53:41 +03:00