You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
will create a single closure environment holding both b (closed over by the function passed to map) and c (closed over by the returned function.)
In this totally disjoint case, ejs could split the closure environments, but I need to investigate if the overhead of splitting the closure makes sense for small environments (I'm guessing no for this particular case, particularly since the closed over variables are never set to anything other than primitives..)
Also, what happens if the sets are not totally disjoint? Take the following:
accesses to d get replaced with something different from within each function:
env_1.env.d in the function passed to map
env_2.env.d in the returned function.
This also has a cost in the increased indirection to get to the d binding, so need some heuristic based on the number of accesses to d to determine if we should just create 1 environment.
The text was updated successfully, but these errors were encountered:
the following function:
will create a single closure environment holding both
b
(closed over by the function passed tomap
) andc
(closed over by the returned function.)In this totally disjoint case, ejs could split the closure environments, but I need to investigate if the overhead of splitting the closure makes sense for small environments (I'm guessing no for this particular case, particularly since the closed over variables are never set to anything other than primitives..)
Also, what happens if the sets are not totally disjoint? Take the following:
so now both functions close over
d
as well.we could make 3 environments in this case;
accesses to
d
get replaced with something different from within each function:env_1.env.d
in the function passed tomap
env_2.env.d
in the returned function.This also has a cost in the increased indirection to get to the
d
binding, so need some heuristic based on the number of accesses tod
to determine if we should just create 1 environment.The text was updated successfully, but these errors were encountered: