mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-19 09:36:47 +02:00
ExprCall::eval: Heap allocate at arity 5+
This commit is contained in:
parent
206ece0f41
commit
91114a6fa4
1 changed files with 7 additions and 2 deletions
|
@ -1766,8 +1766,13 @@ void ExprCall::eval(EvalState & state, Env & env, Value & v)
|
||||||
Value vFun;
|
Value vFun;
|
||||||
fun->eval(state, env, vFun);
|
fun->eval(state, env, vFun);
|
||||||
|
|
||||||
|
// Empirical arity of Nixpkgs lambdas by regex e.g. ([a-zA-Z]+:(\s|(/\*.*\/)|(#.*\n))*){5}
|
||||||
boost::container::small_vector<Value *, 64> vArgs(args.size());
|
// 2: over 4000
|
||||||
|
// 3: about 300
|
||||||
|
// 4: about 60
|
||||||
|
// 5: under 10
|
||||||
|
// This excluded attrset lambdas (`{...}:`). Contributions of mixed lambdas appears insignificant at ~150 total.
|
||||||
|
boost::container::small_vector<Value *, 4> vArgs(args.size());
|
||||||
for (size_t i = 0; i < args.size(); ++i)
|
for (size_t i = 0; i < args.size(); ++i)
|
||||||
vArgs[i] = args[i]->maybeThunk(state, env);
|
vArgs[i] = args[i]->maybeThunk(state, env);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue