tvl-depot/tvix/eval/src/compiler
Vincent Ambo 87995ed355 refactor(tvix/eval): add name-based index over compiler's locals
Instead of finding locals by doing 2x O(n) walks over the compiler's
locals list, use a secondary name-based index for resolving locals by
name.

Previously, almost 60% (!!) of eval time on some expressions over
nixpkgs was spent in `Local::has_name`. This function doesn't even
exist anymore now, and eval speed about doubles as a result.

Note that this doesn't exactly make the locals code easier to read,
but I'm also not sure what we can simplify in there in general.

This fixes b/227.

Change-Id: I29ce5eb9452b02d3b358c673e1f5cf8082e2fef9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7560
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-21 21:48:08 +00:00
..
bindings.rs fix(tvix/eval): fix condition for useless inherit warning 2022-10-23 15:50:35 +00:00
mod.rs refactor(tvix/eval): add name-based index over compiler's locals 2022-12-21 21:48:08 +00:00
scope.rs refactor(tvix/eval): add name-based index over compiler's locals 2022-12-21 21:48:08 +00:00