snix/tvix/eval/src
Vincent Ambo bf286a54bc refactor(tvix/eval): add a LightSpan type for lighter span tracking
This type carries the information required for calculating a
span (i.e. the chunk and offset), instead of the span itself. The span
is then only calculated in cases where it is required (when throwing
errors).

This reduces the eval time for
`builtins.length (builtins.attrNames (import <nixpkgs> {}))` by *one
third*!

The data structure in chunks that carries span information reduces
in-memory size by trading off the speed of retrieving span
information. This is because the span information is only actually
required when throwing errors (or emitting warnings).

However, somewhere along the way we grew a dependency on carrying span
information in thunks (for correctly reporting error chains). Hitting
the code paths for span retrieval was expensive, and carrying the
spans in a different way would still be less cache-efficient. This
change is the best tradeoff I could come up with.

Refs: b/229.
Change-Id: I27d4c4b5c5f9be90ac47f2db61941e123a78a77b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7558
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-21 22:21:25 +00:00
..
builtins refactor(tvix/eval): add a LightSpan type for lighter span tracking 2022-12-21 22:21:25 +00:00
compiler refactor(tvix/eval): add a LightSpan type for lighter span tracking 2022-12-21 22:21:25 +00:00
tests refactor(tvix/eval): use new public API in test code 2022-12-21 13:09:28 +00:00
value refactor(tvix/eval): add a LightSpan type for lighter span tracking 2022-12-21 22:21:25 +00:00
chunk.rs fix(tvix/eval): remove impl PartialEq for Value 2022-11-04 00:30:13 +00:00
errors.rs feat(tvix/eval): add CoercionKind::ThunksOnly 2022-11-28 20:05:33 +00:00
lib.rs refactor(tvix/eval): consume self in Evaluation::evaluate 2022-12-21 13:23:38 +00:00
nix_search_path.rs fix(tvix): distinguish search- and relative path resolution errors 2022-10-21 00:11:29 +00:00
observer.rs feat(tvix/eval): initial attempt at setting lambda names 2022-10-23 15:58:53 +00:00
opcode.rs fix(tvix/eval): change ordinary (//) to rustdoc-comments (///) 2022-11-05 22:07:42 +00:00
pretty_ast.rs fix(tvix/eval): more faithfully serialise ast::Literal 2022-10-16 23:35:59 +00:00
properties.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
source.rs feat(tvix/eval): fancy-format parse errors returned by rnix 2022-10-08 17:27:57 +00:00
spans.rs refactor(tvix/eval): add a LightSpan type for lighter span tracking 2022-12-21 22:21:25 +00:00
systems.rs fix(tvix/eval): correct wasm32-unknown-unknown to wasm32-none 2022-10-27 23:23:22 +00:00
test_utils.rs test(tvix/eval): Add proof-of-concept test for Chunk 2022-09-18 17:55:06 +00:00
upvalues.rs fix(tvix/eval): remove impl PartialEq for Value 2022-11-04 00:30:13 +00:00
vm.rs refactor(tvix/eval): add a LightSpan type for lighter span tracking 2022-12-21 22:21:25 +00:00
warnings.rs feat(tvix/eval): add configuration of Nix search path to public API 2022-12-21 13:23:38 +00:00