1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-19 00:39:37 +01:00
nix/src/libexpr-tests
Sergei Zimmerman 738924b705
libexpr: Slim down Bindings to 8 bytes (on 64 bit systems)
Since the only construction and push_back() calls
to Bindings happen through the `BindingsBuilder` [1] we don't
need to keep `capacity` around on the heap anymore. This saves 8 bytes
(because of the member alignment padding)
per one Bindings allocation. This isn't that much, but it does
save significant memory.

This also shows that the Bindings don't necessarily have to
be mutable, which opens up opportunities for doing small bindings
optimization and storing a 1-element Bindings directly in Value.

For the following scenario:

nix-env --query --available --out-path --file ../nixpkgs --eval-system x86_64-linux

(nixpkgs revision: ddcddd7b09a417ca9a88899f4bd43a8edb72308d)

This patch results in reduction of `sets.bytes` 13115104016 -> 12653087640,
which amounts to 462 MB less bytes allocated for Bindings.

[1]: Not actually, `getBuiltins` does mutate bindings, but this is pretty
     inconsequential and doesn't lead to problems.
2025-09-06 00:23:54 +03:00
..
data Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
pch libexpr-tests: Improve compile times with PCH 2025-08-17 00:56:54 +03:00
value libexpr: Slim down Bindings to 8 bytes (on 64 bit systems) 2025-09-06 00:23:54 +03:00
.version Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
derived-path.cc treewide: Bump C++ standard version to C++23 2025-08-19 15:33:27 +03:00
error_traces.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
eval.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
json.cc Re-introduce mkStringNoCopy (revised) 2025-09-02 00:16:06 +03:00
main.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
meson.build Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
nix-meson-build-support rename: build-utils-meson -> nix-meson-build-support 2024-12-09 16:54:42 +01:00
nix_api_expr.cc Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
nix_api_external.cc Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
nix_api_value.cc Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
nix_api_value_internal.cc Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
package.nix Write just ./.version on all components 2025-02-18 11:41:35 +01:00
primops.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
search-path.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
trivial.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00