From c8bb2371ebf25ab78abde84e3c5742f9844a74b7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Jul 2015 23:11:08 +0200 Subject: Optimize empty sets This reduces the number of Bindings allocations by about 10%. --- src/libexpr/eval.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libexpr/eval.cc') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 044256112d50..14169d85735e 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -281,6 +281,10 @@ EvalState::EvalState(const Strings & _searchPath) for (auto & i : paths) addToSearchPath(i); addToSearchPath("nix=" + settings.nixDataDir + "/nix/corepkgs"); + clearValue(vEmptySet); + vEmptySet.type = tAttrs; + vEmptySet.attrs = allocBindings(0); + createBaseEnv(); } -- cgit 1.4.1